Raised This Month: $48 Target: $400
 12% 

Compiling with AMBuild2: libtier0 and libvstdlib missing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 09-06-2017 , 22:43   Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #1

Hi,

I'm trying to compile https://github.com/komashchenko/PTaH with AMBuild2. Works quite well on Windows and also compiles flawlessly on Linux.

Sadly, when trying to load, I get the following error:

Code:
[08] <FAILED> file "PTaH.ext.2.csgo.so": ......./addons/sourcemod_test/extensions/PTaH.ext.2.csgo.so: undefined symbol: Warning
The reason seems to be that libtier0 and libvstdlib does not get linked.

ldd output of the original binary from original author:
Code:
         linux-gate.so.1 (0xedb43000)
        libvstdlib.so => not found
        libtier0.so => not found
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xed84a000)
        libm.so.6 => /lib32/libm.so.6 (0xed804000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xed7e7000)
        libc.so.6 => /lib32/libc.so.6 (0xed639000)
        /lib/ld-linux.so.2 (0xedb44000)
ldd output of my build:
Code:
         linux-gate.so.1 (0xf10f5000)
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf0fce000)
        libc.so.6 => /lib32/libc.so.6 (0xf0e21000)
        libm.so.6 => /lib32/libm.so.6 (0xf0ddb000)
        /lib/ld-linux.so.2 (0xf10f6000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf0dbe000)
Can somebody tell me what is wrong? I used the original AMBuild script out of the repository. I literally changed nothing.

Thank you!
Chrisber is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-07-2017 , 07:39   Re: Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #2

I believe there's a bug in it with GCC with regard to the order of the libraries. I don't remember the specifics. A workaround is to using clang instead. (Setting CC and CXX when running configure.py)
psychonic is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-07-2017 , 12:01   Re: Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #3

Compiling on my system using each of gcc 4.9.3, 5.4.0, and 6.3.0 results in this for me:
Code:
PTaH/build/package/addons/sourcemod/extensions$ ldd PTaH.ext.2.csgo.so
        libvstdlib.so => not found
        libtier0.so => not found
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/32/libstdc++.so.6 (0xf7362000)
        libm.so.6 => /lib32/libm.so.6 (0xf730e000)
        libc.so.6 => /lib32/libc.so.6 (0xf715f000)
        /lib/ld-linux.so.2 (0x5661a000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/32/libgcc_s.so.1 (0xf7143000)
Fyren is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 09-07-2017 , 14:40   Re: Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #4

Warning is from tier0.

I'd suspect something's up with your SDK (or compiler and or linker as suggested previously); what are you using?
KyleS is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-07-2017 , 15:17   Re: Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #5

This is definitely the well-known GCC problem of it deciding not to link the libs, because it hasn't yet encountered any code that requires them, because our linker flags are in the "wrong" order. Reproducing this broken behaviour is dependent on the distro's linker scripts (--as-needed / --no-as-needed), so it working on one system is not indicative of there not being an issue (there is an issue).
__________________
asherkin is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 09-08-2017 , 08:45   Re: Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #6

Hi,

thanks for your answers.

I'm running gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 on Bash on Windows. Maybe I try it later on my real Linux machine.

@KyleS: I'm using the most recent version of the AM hl2sdk-csgo (from GitHub).
@psychonic: Isn't clang incompatible with GCCs ABI? We are still talking about VALVe...
Chrisber is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-08-2017 , 08:48   Re: Compiling with AMBuild2: libtier0 and libvstdlib missing
Reply With Quote #7

Quote:
Originally Posted by Chrisber View Post
@psychonic: Isn't clang incompatible with GCCs ABI? We are still talking about VALVe...
No, Clang and GCC are fully ABI compatible for C and C++.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:28.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode