https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108259

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
this patch shows the problem - because it removes the shadowing "-L" options. 
Obviously, we cannot apply it without creating 'regressions'...

[PATCH] modula-2, driver: Do not add extra '-L' options that shadow
 $libdir.

The driver is adding one '-L' option for each path to libm2xxx.a which is
shadowing $libpath where the shared libraries are installed.  This prevents
the shared libraries from being found (there are also convenience libs
in $libdir, so the additional -L options are not needed).

gcc/m2/ChangeLog:

        * gm2spec.cc (add_default_combination): Do not add extra library
        paths for the libm2xxx.a libraries.
---
 gcc/m2/gm2spec.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc
index 3c91479df16..4996fa49789 100644
--- a/gcc/m2/gm2spec.cc
+++ b/gcc/m2/gm2spec.cc
@@ -289,7 +289,6 @@ add_default_combination (const char *libpath, const char
*library)
 {
   if (library != NULL)
     {
-      append_option (OPT_L, build_archive_path (libpath, library), 1);
       append_option (OPT_l, safe_strdup (library), 1);
       return true;
     }
--

Reply via email to