I had a similar error trying to build bluez-ps3 with gcc-5, it meant the gcc binary was too old compared to the installed version of binutils which supplies the ld command, downgrading binutils might fix it.
But the current advice from the PCSX2 devs themselves is to patch gcc 9 :
https://github.com/PCSX2/pcsx2/commit/43981f5981b0c5578af2243b3db26f0cdb1a1bbd
Or possibly you could try modifying the PKGBUILD to build with clang / llvm as that is supposedly supported by PCSX2 as well.
$ diff -u ../PKGBUILD PKGBUILD
--- ../PKGBUILD 2019-07-04 17:26:15.005995202 +0100
+++ PKGBUILD 2019-07-04 17:58:05.919491923 +0100
@@ -12,7 +12,7 @@
depends=('lib32-glew' 'lib32-libaio' 'lib32-libcanberra' 'lib32-libjpeg-turbo'
'lib32-libpulse' 'lib32-nvidia-cg-toolkit' 'lib32-portaudio'
'lib32-sdl2' 'lib32-soundtouch' 'lib32-wxgtk2')
-makedepends=('cmake' 'git' 'png++')
+makedepends=('cmake' 'git' 'png++' 'clang' 'llvm')
provides=('pcsx2')
conflicts=('pcsx2')
source=('git+https://github.com/PCSX2/pcsx2.git')
@@ -37,6 +37,9 @@
fi
mkdir build && cd build
+ export CC=/usr/bin/clang
+ export CXX=/usr/bin/clang++
+
cmake .. \
-DCMAKE_BUILD_TYPE='Release' \
-DCMAKE_TOOLCHAIN_FILE='cmake/linux-compiler-i386-multilib.cmake' \
@@ -48,6 +51,7 @@
-DREBUILD_SHADER='TRUE' \
-DGLSL_API='TRUE' \
-DPACKAGE_MODE='TRUE' \
+ -DCMAKE_CXX_COMPILER_ID=Clang \
-DXDG_STD='TRUE'
make
No, after a few tries it still fails to build with clang :
Scanning dependencies of target x86emitter
[ 18%] Building CXX object common/src/x86emitter/CMakeFiles/x86emitter.dir/bmi.cpp.o
[ 19%] Building CXX object common/src/x86emitter/CMakeFiles/x86emitter.dir/cpudetect.cpp.o
/home/me/artix/makepkg/pcsx2/test2/src/pcsx2/common/src/x86emitter/cpudetect.cpp:68:5: error: always_inline function '_fxsave' requires target feature 'xsave', but would be
inlined into function 'SIMD_EstablishMXCSRmask' that is compiled without support for 'xsave'
_fxsave(&targetFXSAVE);
^
1 error generated.
make[2]: *** [common/src/x86emitter/CMakeFiles/x86emitter.dir/build.make:76: common/src/x86emitter/CMakeFiles/x86emitter.dir/cpudetect.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:279: common/src/x86emitter/CMakeFiles/x86emitter.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...