compiling a go-module with cgo and .cxx (swig generated) with the following command on linux/arm:
CGO_LDFLAGS="-no-pie" go build \
-v -x \
What did you expect to see?
the cxx compiler (g++) command as a linker frontend is started with the -no-pie parameter and the without the -pie paramater
What did you see instead?
as you can see, g++ ist started with -no-pie and -pie. the second ond overwrites the first one. But my static library (mylib1) is compiled without-fPIC, so the command fails with "/usr/bin/ld: somefancyapp/libs/linux/arm/libmylib1.a(lib1.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC"
a minimally invasive fix proposal for #45940. which keeps the fix for #26197.
an alternative for (#26197) could be to fail if we have both flags. adding/removing a flag without an message to the user is inconvenient.
Reviewed-by: Cherry Mui <email@example.com>
Run-TryBot: Cherry Mui <firstname.lastname@example.org>
TryBot-Result: Go Bot <email@example.com>
Trust: Bryan C. Mills <firstname.lastname@example.org>