smarco / WFA2-lib

WFA-lib: Wavefront alignment algorithm library v2
Other
162 stars 36 forks source link

Newer `gcc`s happy #70

Closed AndreaGuarracino closed 1 year ago

AndreaGuarracino commented 1 year ago

With

-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0

I need to add -fPIE in CC_FLAGS, else I get

...
[ 63%] Building CXX object src/common/wflign/CMakeFiles/libwflign_static.dir/src/murmur3.cpp.o
[ 72%] Linking CXX static library ../../../lib/libwflign.a
[ 72%] Built target libwflign_static
[ 90%] Building CXX object CMakeFiles/wfmash.dir/src/interface/main.cpp.o
[ 90%] Building CXX object CMakeFiles/wfmash.dir/src/common/utils.cpp.o
[100%] Linking CXX executable bin/wfmash
/usr/bin/ld: /home/guarracino/git/wfmash/src/common/wflign/deps/WFA2-lib/lib/libwfacpp.a(WFAligner.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/wfmash.dir/build.make:114: bin/wfmash] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/wfmash.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

This is not needed with gcc 13.1.0, but I suppose having such a flag, in any case, would not hurt.

What do you think?

smarco commented 1 year ago

WFA2lib compiled standalone does not require -fPIE. I tried using the following:

-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0

I don't understand why we have to build PIC or PIE. Moreover, wfmash should trigger cmake build, not makefile build. There is something I don't fully understand.

The cstdint inclusion is fair.

Thanks,