ice icon indicating copy to clipboard operation
ice copied to clipboard

Bogus build flags for rhel x86 builds

Open pepone opened this issue 2 years ago • 0 comments

We build the x86 packages with this command:

https://github.com/zeroc-ice/ice-packaging/blob/1c4d1eb93138fafbb9a21f4a08040044d67cc5e1/ice/rpm/ice.spec#L455-L470

Here CXXFLAGS contains flags appropriate for x86 builds, these flags end up being used to build Slice compilers in x64 mode (because we always build the Slice compiler using x64)

The build end up failing with

g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -MT src/Slice/build/x64/static/Checksum.o -MMD -MP -MF  src/Slice/build/x64/static/Checksum.Td -Wall -Wextra -Wredundant-decls -Wshadow -Wdeprecated -Werror -pthread -DNDEBUG -Isrc -Isrc/Slice/generated -Iinclude -Iinclude/generated -DICE_BUILDING_SRC -m64 -DICE_STATIC_LIBS  -c src/Slice/Checksum.cpp -o src/Slice/build/x64/static/Checksum.o
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: '-fcf-protection=full' is not supported for this target
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: '-fcf-protection=full' is not supported for this target
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: '-fcf-protection=full' is not supported for this target
make[1]: *** [Makefile:26: src/Slice/build/x64/static/Scanner.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:26: src/Slice/build/x64/static/CPlusPlusUtil.o] Error 1
make[1]: *** [Makefile:26: src/Slice/build/x64/static/Grammar.o] Error 1
cc1plus: error: CPU you selected does not support x86-64 instruction set
cc1plus: error: '-fcf-protection=full' is not supported for this target
make[1]: *** [Makefile:26: src/Slice/build/x64/static/Checksum.o] Error 1
make[1]: Leaving directory '/home/vagrant/workspace/dist-utils/build/ice/builds/rpm/bin/BUILD/ice-3.7/cpp'

The command line contains -m32 -march=i686 and -m64 which is causing the failure.

pepone avatar Jul 01 '22 15:07 pepone