ironseed_fpc icon indicating copy to clipboard operation
ironseed_fpc copied to clipboard

FTBFS on armel (undefined reference to symbol '__aeabi_d2iz@@GCC_3.5')

Open mnalis opened this issue 5 years ago • 2 comments

Fails to build from source: https://buildd.debian.org/status/package.php?p=ironseed This has extra error in comparison to armhf & arm64

(9015) Linking is
is.pas(86,1) Warning: (9034) "crtbeginS.o" not found, this will probably cause a linking failure
is.pas(86,1) Warning: (9034) "crtendS.o" not found, this will probably cause a linking failure
/usr/bin/ld.bfd: c_utils.o: undefined reference to symbol '__aeabi_d2iz@@GCC_3.5'
/usr/bin/ld.bfd: /lib/arm-linux-gnueabi/libgcc_s.so.1: error adding symbols: DSO missing from command line
is.pas(86,1) Error: (9013) Error while linking
is.pas(86,1) Fatal: (10026) There were 3 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /usr/bin/ppcarm returned an error exitcode
make[2]: *** [Makefile:81: is] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
dh_auto_build: error: make -j1 "INSTALL=install --strip-program=true" prefix=/usr libdir=/usr/libexec/ironseed returned exit code 2
make[1]: *** [debian/rules:14: override_dh_auto_build] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:8: binary-arch] Error 2

mnalis avatar Dec 24 '20 20:12 mnalis

In addition to warning aborting compilation (reported in https://github.com/mnalis/ironseed_fpc/issues/87) this has issues as fpc does not seem to link libgcc_s, which is needed on some architectures do divide double precision floating point numbers.

Also, just adding -lgcc_s does not work as it then breaks on x86_64, for example. Linking only when needed with --as-needed also does not work due to position in linker script where fpc puts it.

More related information:

  • https://forum.lazarus.freepascal.org/index.php?topic=15712.0
  • https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html
  • https://wiki.osdev.org/Libgcc
  • https://github.com/pikhq/bootstrap-linux/issues/8
  • https://community.nxp.com/t5/CodeWarrior-Development-Tools/aeabi-d2iz/m-p/383841

mnalis avatar Dec 27 '20 02:12 mnalis

now it compiles as we manually bruteforce calculated library path and force linking with libgcc_s, but that makes required shared lib that should not be needed (on other architectures, like armhf, dpkg-shlibdeps warns against it.)

Ideally, we'd find out how to sort libraries so -lgcc_s is only --as-needed. Alternatively, but less cleanly, we can modify makefile to detect hardcoded architectures that need libgcc_s and set FORCE_LIBGCC=1 and add it to linker flags only if required (and add the error to the docs so people compiling will know if they need it elsewhere).

mnalis avatar Jan 14 '21 01:01 mnalis