Fix error in logic of toolchain building

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>