1. Compile problem

I'm trying to compile one of my Euphoria programs.

Here's the command line invocation:

# euc -extra-lflags="-no-pie -lm" myprog.eui 

Here's the result:

Compiling  95% 0et.c 
Compiling  98% graphics.c 
Linking 100% ../myprog 
/usr/bin/ld: /usr/local/bin/eu.a(be_runtime.o): in function `power': 

be_runtime.c:(.text+0x4061): undefined reference to `__powl_finite' 

/usr/bin/ld: /usr/local/bin/eu.a(be_runtime.o): in function `Dpower': 

be_runtime.c:(.text+0x40dc): undefined reference to `__powl_finite' 

/usr/bin/ld: /usr/local/bin/eu.a(be_runtime.o): in function `e_log': 

be_runtime.c:(.text+0x417f): undefined reference to `__log_finite' 

/usr/bin/ld: /usr/local/bin/eu.a(be_runtime.o): in function `De_log': 

be_runtime.c:(.text+0x41c1): undefined reference to `__log_finite' 

collect2: error: ld returned 1 exit status 
Unable to link /var/www/html/cgi-bin/myprog 
Status: 1 Command: gcc -o /var/www/html/cgi-bin/myprog  init-.o myprog.o main-.o io.o error.o machine.o memory.o dll.o types.o text.o convert.o search.o filesys.o datetime.o get.o scinot.o math.o sequence.o sort.o wildcard.o pretty.o cw_cgi.o eds.o os.o eulibcURL.o wrapper.o console.o eumem.o stats.o cw.o locale.o 0et.o graphics.o   /usr/local/bin/eu.a -m64 -ldl -lm -lpthread -no-pie -lm 

Here's the gcc version:

# gcc -v 
Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper 
OFFLOAD_TARGET_NAMES=nvptx-none:hsa 
OFFLOAD_TARGET_DEFAULT=1 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) 

This is way out of my competence. Can anyone help?

Thanks,

Craig

new topic     » topic index » view message » categorize

2. Re: Compile problem

This was discussed back in October: https://openeuphoria.org/forum/135124.wc.

Unfortunately my response hasn't changed since then:

ghaberek said...

This thread on the libc-alpha mailing list seems to confirm the problem: https://sourceware.org/pipermail/libc-alpha/2020-May/thread.html#113773

I don't really have a solution at the moment. You could just build your project on Ubuntu 18.04 and it should work on all future versions.

You could also build Euphoria from source on the Ubuntu 20.04 system and it should work, but obviously that has its own set of issues.

I have a feeling we're either going to have to drop support for older versions of libc or start shipping different builds for different Linux distros (probably via deb/rpm packages).

In the meantime, can you get by with building on Ubuntu 18.04 or using the binder instead?

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Compile problem

Thanks Greg.

I have no easy way of trying under an earlier Ubuntu release.

I'll try the binder. I'm just seeking a speed increase.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Compile problem

It occurred to me that if you're already using the translator then you should be able to rebuild the library from source. This should resolve both the "-no-pie" problem and this libc issue.

# Clone the Euphoria source repo 
git clone --depth=1 https://github.com/OpenEuphoria/euphoria OpenEuphoria/euphoria 
 
# Change to the source directory 
cd OpenEuphoria/euphoria/source 
 
# Run the configure script 
./configure 
 
# Build the library 
make library 
 
# Backup the installed library (optional) 
sudo mv /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a{,.bak} 
 
# Install the new library 
sudo cp build/eu.a /usr/local/euphoria-4.1.0-Linux-x64/bin/ 

I tested this on Linux Mint 20.1 which is based on Ubuntu 20.04. You shouldn't have to provide any "extra" flags when translating. Your executable probably won't run on older systems though.

Hope this helps.

-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: Compile problem

Wow, what a useful suggestion, thanks. It would not have occurred to me, in over a decade of using Euphoria I've never actually rolled my own. It will take me a day or two to check which library routines I have changed (math:median, for example) and put them to one side, then I'll try that. Will post here how it went.

Thanks again,

Craig

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu