Skip to content

Commit

Permalink
Fix gac on Linux if a package with kernel ext is present
Browse files Browse the repository at this point in the history
Reported by Bill Allombert: compiling a simple test program via, say,
`gac catp.g -o catp`, and then running it results in an error like this:

    [... GAP banner here ...]
    Loading the library and packages ...
    #W dlopen() error:
    SOMEPATH/pkg/io/bin/x86_64-pc-linux-gnu-default64-kv7/io.so:\
    undefined symbol: ChangedBags

This was caused by the linker invocation in gac missing the `-export-dynamic`
flag

This patch also fixes a second issue: While GAP deliberately links using the C
compiler, the linker command in gac used the C++ compiler for linking. Now
both use the C compiler, ensuring consistent behavior.

Note that we quite deliberately use the C compiler to link, despite GAP
containing C++ code: that code that is careful not to use the C++ standard
library and for which RTTI and exceptions are disabled
  • Loading branch information
fingolfin committed May 6, 2020
1 parent 7b14c09 commit 28ca9d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cnf/gac.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ libtool="$SHELL ${abs_top_builddir}/libtool"
# These three should be filled in by the standard autoconf procedures
c_compiler="$libtool --mode=compile $GAP_CC"
cxx_compiler="$libtool --mode=compile $GAP_CXX"
c_linker="$libtool --mode=link $GAP_CXX"
c_linker="$libtool --mode=link $GAP_CC -export-dynamic"

# These will need special care
c_dyn_linker="$libtool --mode=link $GAP_CXX -module -avoid-version -rpath $libdir"
c_dyn_linker="$libtool --mode=link $GAP_CC -module -avoid-version -rpath $libdir"
c_addlibs=""

SYS_IS_CYGWIN32=@SYS_IS_CYGWIN32@
Expand Down

0 comments on commit 28ca9d4

Please sign in to comment.