1. Recompile with -fPIE

When I'm trying to use euc, I get this:

Linking 100% ../pi 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o): relocation R_X86_64_32 against symbol `screen_image' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_alloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_pcre.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_socket.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_task.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_callc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(pcre_compile.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(pcre_exec.o): relocation R_X86_64_32 against symbol `_pcre_default_tables' can not be used when making a PIE object; recompile with -fPIE 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(pcre_fullinfo.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE 
collect2: error: ld returned 1 exit status 
Unable to link /home/tom/Documents/Coding/Euphoria/pi 
Status: 1 Command: gcc -o /home/tom/Documents/Coding/Euphoria/pi  init-.o pi.o main-.o math.o types.o text.o convert.o search.o machine.o## ##memory.o dll.o filesys.o datetime.o get.o scinot.o sequence.o sort.o   /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a -m64 -ldl -lm -lpthread 

Is there any way to fix this?

Thanx!

new topic     » topic index » view message » categorize

2. Re: Recompile with -fPIE

Pirx said...

Is there any way to fix this?

Yes, add -extra-lflags="-no-pie" to your euc command. This will force the linker to make a standard PIC executable instead.

-Greg

P.S. I updated your post to use code block formatting {{{ like this }}} instead of inline-code formatting ##like this##.

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

3. Re: Recompile with -fPIE

Thanx Greg! That helped, but I have another problem. This time it looks like this:

/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o): in function `power': 
be_runtime.c:(.text+0x4061): undefined reference to `__powl_finite' 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o): in function `Dpower': 
be_runtime.c:(.text+0x40dc): undefined reference to `__powl_finite' 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/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/euphoria-4.1.0-Linux-x64/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 /home/tom/Documents/Coding/Euphoria/pi 
Status: 1 Command: gcc -o /home/tom/Documents/Coding/Euphoria/pi  init-.o pi.o main-.o math.o types.o text.o convert.o search.o machine.o memory.o dll.o filesys.o datetime.o get.o scinot.o sequence.o sort.o   /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a -m64 -ldl -lm -lpthread -no-pie 

No matter how simple Euphoria code is. I always get this error message.

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

4. Re: Recompile with -fPIE

Pirx said...

No matter how simple Euphoria code is. I always get this error message.

This is caused by later versions of libm having removed those functions (__powl_finite, etc.) in recent distros. This was also discussed here (07 Apr 2021) and here (17 Oct 2020).

Unfortunately there's no immediate fix until we can get a new release out, which I'm still gradually chipping away at. In the mean time, the best solutions I can offer are:

  1. build on an older distro like Ubuntu 18.04 (the executable should be forward-compatible)
  2. build your own copy of the library from source: https://openeuphoria.org/forum/m/136073.wc

I just re-tested the "build your own library" option again on an Ubuntu 20.04 machine in WSL and seems to work fine.

-Greg

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

5. Re: Recompile with -fPIE

I managed to build eu.a from source (I'm using Sparky Linux based on Debian Bullseye), but it doesn't work.

/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_alloc.o):(.bss+0x80): multiple definition of `key_write'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x14): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_alloc.o):(.bss+0xa0): multiple definition of `key_buff'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x20): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o):(.bss+0x360): multiple definition of `alt_image_debug'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x60): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o):(.bss+0xedc0): multiple definition of `alt_image_main'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0xeac0): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o):(.bss+0x1d820): multiple definition of `screen_image'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x1d520): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o):(.bss+0x2c280): multiple definition of `consize_ioctl'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x54): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o):(.bss+0x2c284): multiple definition of `key_write'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x14): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_runtime.o):(.bss+0x2c2a0): multiple definition of `key_buff'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x20): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_task.o):(.bss+0x88): multiple definition of `consize_ioctl'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x54): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_task.o):(.bss+0x8c): multiple definition of `key_write'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x14): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_task.o):(.bss+0xa0): multiple definition of `key_buff'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x20): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o):(.bss+0x558): multiple definition of `consize_ioctl'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x54): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o):(.bss+0x1da20): multiple definition of `screen_image'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x1d520): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o):(.bss+0x560): multiple definition of `alt_image_debug'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x60): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o):(.bss+0xefc0): multiple definition of `alt_image_main'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0xeac0): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o):(.bss+0x2c480): multiple definition of `key_write'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x14): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_machine.o):(.bss+0x2c4a0): multiple definition of `key_buff'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x20): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_pcre.o):(.bss+0x0): multiple definition of `consize_ioctl'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x54): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_pcre.o):(.bss+0x4): multiple definition of `key_write'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x14): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_pcre.o):(.bss+0x20): multiple definition of `key_buff'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x20): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_socket.o):(.bss+0x0): multiple definition of `key_write'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x14): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_socket.o):(.bss+0x20): multiple definition of `key_buff'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x20): first defined here 
/usr/bin/ld: /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_socket.o):(.bss+0x54): multiple definition of `consize_ioctl'; /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a(be_w.o):(.bss+0x54): first defined here 
collect2: error: ld returned 1 exit status 
Unable to link /home/tom/Downloads/test 
Status: 1 Command: gcc -o /home/tom/Downloads/test  init-.o test.o main-.o   /usr/local/euphoria-4.1.0-Linux-x64/bin/eu.a -m64 -ldl -lm -lpthread 

Thanx anyway! :)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu