pspdev / psptoolchain-allegrex

This program will automatically build and install an Allegrex compiler which is used in the creation of homebrew software for the Sony PlayStation® Portable videogame system.
MIT License
11 stars 10 forks source link

[Info] Additional modifications necessary to build for current UNIX-like systems #45

Open worduk opened 1 week ago

worduk commented 1 week ago

Current build succeeds with disabling --with-python=no for binutils-gdb and removal of -ffat-lto-objects and -flto in pthread-embedded/platform/psp/Makefile

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-14.2.1_p20240831/work/gcc-14-20240831/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/14 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/14/python --enable-objc-gc --enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,m2,rust --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 14.2.1_p20240831 p5' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --enable-cet --disable-systemtap --disable-valgrind-annotations --enable-vtable-verify --with-zstd --with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie --enable-host-bind-now --enable-default-ssp --disable-fixincludes --with-build-config='bootstrap-O3 bootstrap-lto bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.1 20240831 (Gentoo 14.2.1_p20240831 p5) 
GNU assembler version 2.43.1 (x86_64-pc-linux-gnu) using BFD version (Gentoo 2.43 p2) 2.43.1
Python 3.13.0rc1 (main, Sep  5 2024, 20:25:23) [GCC 14.2.1 20240831]
Linux-6.10.8-gentoo x86_64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz GenuineIntel
sharkwouter commented 1 week ago

When the build is made within the GitHub Actions, we do build binutils without python support, to make the resulting binary work on more systems.

worduk commented 1 week ago

Yes, I already noticed post #8 but the modification is necessary for non GitHub Actions CI builds.

sharkwouter commented 1 week ago

I am quite surprised that you are having issues on Gentoo to be honest. We have the toolchain building and running just fine on many distributions. Are you sure you are not just missing some libraries? What is the error message you are seeing?

jopadan commented 6 days ago

As you already know the reason for the --with-python=no workaround is:

  CXX    python/py-infevents.o
../../gdb/python/py-gdb-readline.c: In function ‘char* gdbpy_readline_wrapper(FILE*, FILE*, const char*)’:
../../gdb/python/py-gdb-readline.c:59:29: error: ‘_PyOS_ReadlineTState’ was not declared in this scope; did you mean ‘PyOS_Readline’?
   59 |       PyEval_RestoreThread (_PyOS_ReadlineTState);
      |                             ^~~~~~~~~~~~~~~~~~~~
      |                             PyOS_Readline
  CXX    python/py-infthread.o
make[2]: *** [Makefile:1897: python/py-gdb-readline.o] Error 1

Removal of -ffat-lto-objects and -flto in pthread-embedded is necessary for gcc-stage2 and pspsdk to avoid No LTO compiled in or enabled messages.