LIHPC-Computational-Geometry / metis-rs

Idiomatic wrapper for METIS, the serial graph partitioner and fill-reducing matrix orderer
https://lihpc-computational-geometry.github.io/metis-rs/metis/
Apache License 2.0
11 stars 9 forks source link

Linux -fPIE build failure #32

Closed JMS55 closed 5 months ago

JMS55 commented 7 months ago

I get an error on Linux when linking against some kind of .rlib from libmetris_sys gklib.o

,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/jms/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/jms/Projects/bevy/target/release/examples/meshlet-e26ebb2941c08c68" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/jms/Projects/bevy/target/release/deps/libmetis_sys-5573fe5096f72fe6.rlib(f6cd32e89e94ec8c-gklib.o): relocation R_X86_64_32 against `.rodata' 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
JMS55 commented 7 months ago

Looks like it's the force-optimize-vendor feature causing the problem. Disabling it compiles fine.

Also, weirdly, leaving it on but trying to use use-system has the same issue. I'm not convinced that use-system is working.

cedricchevalier19 commented 7 months ago

I'll try to reproduce it. Thanks for reporting it.

cedricchevalier19 commented 5 months ago

Fixed in #33.