Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't compile with the latest nauty-27r3: relocation R_X86_64_PC32 cannot be used against symbol __stack_chk_guard #58

Closed
yurivict opened this issue Sep 20, 2021 · 2 comments

Comments

@yurivict
Copy link

yurivict commented Sep 20, 2021

(and maybe doesn't compile with any version of nauty.)

*** Warning: Linking the shared library libCouenne.la against the
*** static library /usr/local/lib/libnauty.a is not portable!
c++ -shared -nostdlib /usr/lib/crti.o /usr/lib/crtbeginS.o  .libs/CouenneBab.o .libs/BonCouenneSetup.o .libs/SmartAslDestr.o -Wl,--whole-archive ./interfaces/.libs/libCouenneInterfaces.a ./heuristics/.libs/libCouenneHeuristics.a ./problem/.libs/libCouenneProblem.a ./standardize/.libs/libCouenneStandardize.a ./expression/.libs/libCouenneExpression.a ./branch/.libs/libCouenneBranch.a ./convex/.libs/libCouenneConvex.a ./bound_tightening/.libs/libCouenneBoundTightening.a ./bound_tightening/twoImpliedBT/.libs/libCouenneTwoImplied.a ./util/.libs/libCouenneUtil.a ./disjunctive/.libs/libCouenneDisjunctive.a ./cut/crossconv/.libs/libCouenneCrossConv.a ./cut/sdpcuts/.libs/libCouenneSdpCuts.a -Wl,--no-whole-archive  -L/usr/local/lib -L/usr/local/lib/gcc10 /usr/local/lib/libnauty.a -lbonminampl -L/usr/local/bin -L/usr/local/lib/gcc10/gcc/x86_64-portbld-freebsd13.0/10.3.0 -L/usr/local/lib/gcc10/gcc/x86_64-portbld-freebsd13.0/10.3.0/../../../../../x86_64-portbld-freebsd13.0/lib -L/usr/local/lib/gcc10/gcc/x86_64-portbld-freebsd13.0/10.3.0/../../.. -lipoptamplinterface -lbonmin -lCbcSolver -lCbc -lnauty -lCgl -lOsi -lCoinUtils -lbz2 -lz -lopenblas -lOsiClp -lClpSolver -lClp -lcoinasl -lipopt -llapack -ldl -lcoinmumps -lblas -lgfortran -lssp_nonshared -lquadmath -lcoinmetis -L/usr/lib -lc++ -lm -lc -lgcc -lgcc_s /usr/lib/crtendS.o /usr/lib/crtn.o  -Wl,-rpath=/usr/local/lib/gcc10 -Wl,-soname -Wl,libCouenne.so.1 -o .libs/libCouenne.so.1.4.8
ld: error: relocation R_X86_64_PC32 cannot be used against symbol __stack_chk_guard; recompile with -fPIC
>>> defined in /lib/libc.so.7
>>> referenced by nauty.c
>>>               nauty.o:(nauty) in archive /usr/local/lib/libnauty.a

ld: error: relocation R_X86_64_PC32 cannot be used against symbol __stderrp; recompile with -fPIC
>>> defined in /lib/libc.so.7
>>> referenced by nauty.c
>>>               nauty.o:(nauty) in archive /usr/local/lib/libnauty.a

The core reason is that libnauty.a wasn't built with -fPIC and libnauty.so isn't generally available.

On a side note: nauty now provides the pkgconfig's .pc file. You can use it to discover nauty instead of --with-nauty-lib.

On FreeBSD we build libnauty.so in the port, so there's a workaround.
Otherwise the Nauty option in Couenne is probably generally broken due to the lack of libnauty.so.

You can ask the Nauty authors to build libnauty.so.

OS: FreeBSD 13

@svigerske
Copy link
Member

So building a shared lib of Couenne with a static non-PIC version of the Nauty lib doesn't work. What should Coeunne do to fix the nauty lib?

Either build nauty with -fPIC (as the error message clearly says) or build Couenne as static lib, too (--disable-shared).

@yurivict
Copy link
Author

I am just reporting the problem. Not sure what Couenne should or can do.

I think that they just removed -fPIC in nauty-27r3 - this triggered this problem. Installed static libraries generally are expected to have non-PIC code, so it is correct as it is now.

In the long run they should build lubnauty.so - this would fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants