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

Message ID 20230107105349.92210-1-iain@sandoe.co.uk
State Accepted
Headers
Series modula-2, driver: Do not add extra '-L' options that shadow $libdir. |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Iain Sandoe Jan. 7, 2023, 10:53 a.m. UTC
  tested on x86_64-linux-gnu, i686, powerpc, x86_64 darwin,
note that this patch does expose PR108261 (but that is a separate issue).
OK for trunk?
thanks
Iain

--- 8< ---

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(-)
  

Patch

diff --git a/gcc/m2/gm2spec.cc b/gcc/m2/gm2spec.cc
index dbfd1cacccc..f6d216269c1 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;
     }