Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Cannot compile: “./.libs/libelemental.so: undefined reference to `rb_set_inherit'” #203

Open
progval opened this issue Dec 22, 2015 · 17 comments

Comments

@progval
Copy link

progval commented Dec 22, 2015

$ make -j4
[…]
  CCLD     libelemental.la
  CCLD     ircd
./.libs/libelemental.so: undefined reference to `rb_set_inherit'
collect2: error: ld returned 1 exit status
Makefile:575: recipe for target 'ircd' failed
make[1]: *** [ircd] Error 1
make[1]: Leaving directory '/home/progval/irc/elemental-ircd/src'
Makefile:445: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

ld version:

GNU ld (GNU Binutils for Debian) 2.25

gcc version:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10)

OS: Debian 8.2

@Xe
Copy link
Member

Xe commented Dec 22, 2015

Strange. try this:

$ make clean
$ make

I think the parallel build might be interfering with it?

@progval
Copy link
Author

progval commented Dec 22, 2015

No change.

@ariscop
Copy link
Contributor

ariscop commented Dec 22, 2015

Do you have libratbox installed? rb_set_inherit is only in our branch

@progval
Copy link
Author

progval commented Dec 22, 2015

No.

@ariscop
Copy link
Contributor

ariscop commented Dec 22, 2015

That is to say do you have the version from debian installed, i'm not sure if they package it separately

@progval
Copy link
Author

progval commented Dec 22, 2015

It is packaged as ircd-ratbox (according to Debian bug 485703). And I don't have it installed.

@ariscop
Copy link
Contributor

ariscop commented Dec 22, 2015

current git head compiles fine in a clean container, which sources are you using?

@progval
Copy link
Author

progval commented Dec 22, 2015

git head too

@ariscop
Copy link
Contributor

ariscop commented Dec 22, 2015

double check git status?

@progval
Copy link
Author

progval commented Dec 22, 2015

confirmed.

I think the work is on my side now.

@progval
Copy link
Author

progval commented Dec 22, 2015

I set up a clean env:

$ sudo debootstrap jessie chroot/
$ sudo chroot chroot/
# apt-get install libssl-dev autoconf autoconf-archive build-essential flex bison libsqlite3-dev automake libtool
# apt-get install git
# export LANG=C
# export LC_CTYPE=C

Then, I can't even ./configure:

# git clone https://github.com/Elemental-IRCd/elemental-ircd.git
# cd elemental-ircd/
# ./autogen.sh
# ./configure
[…]
./configure: line 15312: syntax error near unexpected token `SQLITE,'
./configure: line 15312: `PKG_CHECK_MODULES(SQLITE, sqlite3 > 3.0.0)'

Of course libsqlite3-dev is installed:

# apt-cache show libsqlite3-dev
Package: libsqlite3-dev
Source: sqlite3
Version: 3.8.7.1-1+deb8u1
[…]

@ariscop
Copy link
Contributor

ariscop commented Dec 22, 2015

you need pkg-config, it provides the PKG_CHECK_MODULES macro

@progval
Copy link
Author

progval commented Dec 22, 2015

I found the issue. As you said, it's because I have another version of libratbox installed.

But I did not find it at first, because it is in $PREFIX/lib/libratbox.so, and usually, applications do not look at $PREFIX outside the make install part.

Feel free to close this if you don't consider it as an issue.

@Xe
Copy link
Member

Xe commented Dec 22, 2015

This is really interesting. It may not be a direct bug in Elemental (a side effect of the circumstance of already having ratbox installed in $PREFIX), but it's probably indirectly caused by #94 I think.

@ariscop
Copy link
Contributor

ariscop commented Dec 23, 2015

#94 would work around the issue, i don't think it should be searching the system path at all though, long as we have our own libratbox

@ariscop
Copy link
Contributor

ariscop commented Dec 23, 2015

almost looks like a libtool bug

@Xe
Copy link
Member

Xe commented Dec 23, 2015

Hmm, yeah. Makes sense.

Is there another thing we can do to make elemental's libratbox incompatible with ratbox's? I'm not the most familiar with libtool but there has to be something that can be rejiggered around.

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

No branches or pull requests

3 participants