I am trying to build fonts/harfbuzz on a CentOS machine and am running into an issue with the linker.
The problem occurs when the configure scripts checks if the compiler is working; it decides it is not.
Harfbuzz has GCC_REQD=4.9 set, gcc49 is installed as a dependency, and it is run when configure is checking for a working compiler. However, the following error is in config.log:
configure:4516: checking whether the C compiler works
configure:4538: cc -O2 -I/project/pkgsrc/pkg-2020Q1/include -I/project/pkgsrc/pkg-2020Q1/include/glib-2.0 -I/project/pkgsrc/pkg-2020Q1/include/gio-unix-2.0 -I/project/pkgsrc/pkg-2020Q1/lib/glib-2.0/include -I/usr/include -I/project/pkgsrc/pkg-2020Q1/include/freetype2 -I/project/pkgsrc/pkg-2020Q1/include -I/project/pkgsrc/pkg-2020Q1/include/glib-2.0 -I/project/pkgsrc/pkg-2020Q1/include/gio-unix-2.0 -I/project/pkgsrc/pkg-2020Q1/lib/glib-2.0/include -I/usr/include -I/project/pkgsrc/pkg-2020Q1/include/freetype2 -L/project/pkgsrc/pkg-2020Q1/gcc49/lib/gcc/x86_64-redhat-linux/4.9.4 -Wl,-R/project/pkgsrc/pkg-2020Q1/gcc49/lib/gcc/x86_64-redhat-linux/4.9.4 -L/project/pkgsrc/pkg-2020Q1/lib -Wl,-R/project/pkgsrc/pkg-2020Q1/lib -L/usr/lib64 -Wl,-R/usr/lib64 conftest.c >&5
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
It seems that gcc49 is running the native linker in some way that prevents it from finding /usr/lib64/libgcc_s.so.1, which does exist.
What should be done in a situation like this? Is there a need to use a different linker somehow? Any advice is welcome.
Thanks.
Cheers,
Brook