With the information above, it seems there's a regression risk if we fix this bug in python2.7 in Focal, and the risk outstands the benefits of the fix, as it seems to be an uncommon use-case and there's a workaround for it, so we wouldn't be able to apply the patch.
Alright, thanks for the information @Steve.
Hi @Nafees,
With the information above, it seems there's a regression risk if we fix this bug in python2.7 in Focal, and the risk outstands the benefits of the fix, as it seems to be an uncommon use-case and there's a workaround for it, so we wouldn't be able to apply the patch.
As a workaround, you can:
1. Export the desired CFLAGS in ~/.bashrc:
i.e.:
export CFLAGS= "-fno-strict- aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug- prefix- map=/build/ python2. 7-vvQ8AI/ python2. 7-2.7.18= . -fstack- protector- strong -Wformat -Werror= format- security"
2. Source .bashrc and compile:
ubuntu@ ip-172- 31-43-65: ~/testprog$ source ~/.bashrc ip-172- 31-43-65: ~/testprog$ python2 setup.py build_ext --inplace linux-gnu- gcc -pthread -fno-strict- aliasing -fno-strict- aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug- prefix- map=/build/ python2. 7-vvQ8AI/ python2. 7-2.7.18= . -fstack- protector- strong -Wformat -Werror= format- security -fPIC -I/usr/ include/ python2. 7 -c testmodule.c -o build/temp. linux-aarch64- 2.7/testmodule. o linux-aarch64- 2.7 linux-gnu- gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic- functions -Wl,-Bsymbolic- functions -Wl,-z,relro -fno-strict- aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug- prefix- map=/build/ python2. 7-vvQ8AI/ python2. 7-2.7.18= . -fstack- protector- strong -Wformat -Werror= format- security -Wl,-Bsymbolic- functions -Wl,-z,relro -fno-strict- aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug- prefix- map=/build/ python2. 7-vvQ8AI/ python2. 7-2.7.18= . -fstack- protector- strong -Wformat -Werror= format- security -fPIC build/temp. linux-aarch64- 2.7/testmodule. o -o build/lib. linux-aarch64- 2.7/test. so linux-aarch64- 2.7/test. so ->
ubuntu@
running build_ext
building 'test' extension
aarch64-
creating build/lib.
aarch64-
copying build/lib.
3. You will have the desired CFLAGS:
ubuntu@ ip-172- 31-43-65: ~/testprog$ strings build/lib. linux-aarch64- 2.7/test. so | grep -- -O aliasing -fwrapv -fstack- protector- strong -fPIC -fasynchronous- unwind- tables -fstack- protector- strong -fstack- clash-protectio n
GNU C17 9.4.0 -mlittle-endian -mabi=lp64 -g -g -O2 -fno-strict-
Would that work for you moving forward?
Regards,
Fabio Martins