From 0ac4f945c06452f4a999b4de0f2ae80581c532c4 Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Sat, 14 Nov 2020 17:23:54 +0100 Subject: [PATCH] Remove */lib paths from m4 (Issu #4095: boinc fails to link with LLD) BOINC fails to link with LLD because of /usr/lib in the link command line. LLD does not continue to search for the correct library, once it finds one that doesn't fit. This is made by design and will not change. See also : https://bugs.gentoo.org/732024 The reason for LLD failing is, that its build system puts -L/usr and -L/usr/lib into the command line options. While these are not neccessary at all, they cause LLD to find 32bit libraries on 64bit systems first. As these 32bit libraries can not be used, LLD errors out. This commit removes the superfluous hard-coded injection of -L/usr and -L/usr/lib into the command line. The resulting build system has been tested with * Clang + LLD * gcc + ld.bfd * gcc + ld.gold Bug: #4095 Signed-off-by: Sven Eden --- m4/ax_check_gl.m4 | 6 +++--- m4/ax_check_glu.m4 | 4 ++-- m4/ax_check_glut.m4 | 4 ++-- m4/check_ssl.m4 | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/m4/ax_check_gl.m4 b/m4/ax_check_gl.m4 index e26ce5b930..5984130004 100644 --- a/m4/ax_check_gl.m4 +++ b/m4/ax_check_gl.m4 @@ -39,7 +39,7 @@ else GL_CFLAGS="-I${x_includes} -I${prefix}/include ${GL_CFLAGS}" fi if test -n "$x_libraries"; then - GL_LIBS="-L${x_libraries} -L${prefix}/lib -lX11 ${GL_LIBS}" + GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}" fi fi @@ -58,7 +58,7 @@ else else ax_try_lib="${ax_lib}" fi - LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" + LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ # if HAVE_WINDOWS_H && defined(_WIN32) @@ -66,7 +66,7 @@ else # endif # include ]], [[glBegin(0)]])], - [ax_cv_check_gl_libgl="-L${prefix}/lib ${ax_try_lib}"; break]) + [ax_cv_check_gl_libgl="${ax_try_lib}"; break]) done LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS}]) diff --git a/m4/ax_check_glu.m4 b/m4/ax_check_glu.m4 index 7a8105a535..d1c22fa3ce 100644 --- a/m4/ax_check_glu.m4 +++ b/m4/ax_check_glu.m4 @@ -19,7 +19,7 @@ if test "X${with_apple_opengl_framework}" != "Xyes"; then else ax_try_lib="${ax_lib}" fi - LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" + LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" # # libGLU typically links with libstdc++ on POSIX platforms. However, # setting the language to C++ means that test program source is named @@ -37,7 +37,7 @@ if test "X${with_apple_opengl_framework}" != "Xyes"; then # endif # include ]], [[gluBeginCurve(0)]])], - [ax_cv_check_glu_libglu="-L${prefix}/lib ${ax_try_lib}"; break]) + [ax_cv_check_glu_libglu="${ax_try_lib}"; break]) if test X$ax_compiler_ms = Xyes; then AC_LANG_POP([C]) fi diff --git a/m4/ax_check_glut.m4 b/m4/ax_check_glut.m4 index 7c5280cce7..ee9d34b53f 100644 --- a/m4/ax_check_glut.m4 +++ b/m4/ax_check_glut.m4 @@ -41,7 +41,7 @@ else else ax_try_lib="${ax_lib}" fi - LIBS="-L${prefix}/lib ${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" + LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ #define FREEGLUT_STATIC 1 @@ -50,7 +50,7 @@ else # endif # include ]], [[glutMainLoop()]])], - [ax_cv_check_glut_libglut="-L${prefix}/lib ${ax_try_lib}"; break]) + [ax_cv_check_glut_libglut="${ax_try_lib}"; break]) done LIBS=${ax_save_LIBS} diff --git a/m4/check_ssl.m4 b/m4/check_ssl.m4 index 49b64c3f9f..3c68e0cae3 100644 --- a/m4/check_ssl.m4 +++ b/m4/check_ssl.m4 @@ -46,7 +46,7 @@ if test "x${SSL_LIBS}" = "x" ; then SSLDIR="${ssldir}" SSL_CFLAGS="-I$ssldir/include -I$ssldir/include/openssl"; SSL_CXXFLAGS="-I$ssldir/include -I$ssldir/include/openssl"; - SSL_LIBS="-L$ssldir -L$ssldir/lib -lssl -lcrypto" + SSL_LIBS="-lssl -lcrypto" AC_CHECK_LIB([dl], [dlopen], [SSL_LIBS="${SSL_LIBS} ${sah_lib_last}"]) AC_CHECK_LIB([z], [gzopen], @@ -58,7 +58,7 @@ if test "x${SSL_LIBS}" = "x" ; then SSLDIR="${ssldir}" SSL_CFLAGS="-I$ssldir/include/" SSL_CXXFLAGS="-I$ssldir/include/" - SSL_LIBS="-L$ssldir -L$ssldir/lib -lssl -lcrypto" + SSL_LIBS="-lssl -lcrypto" AC_CHECK_LIB([dl], [dlopen], [SSL_LIBS="${SSL_LIBS} ${sah_lib_last}"]) AC_CHECK_LIB([z], [gzopen],