[COMMITTED] ada: Pass -msmp when linking for ppc-vx6 --RTS=rtp-smp

Message ID 20230905110816.562928-1-poulhies@adacore.com
State Accepted
Headers
Series [COMMITTED] ada: Pass -msmp when linking for ppc-vx6 --RTS=rtp-smp |

Checks

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

Commit Message

Marc Poulhiès Sept. 5, 2023, 11:08 a.m. UTC
  From: Alexandre Oliva <oliva@adacore.com>

gprbuild and gnatmake won't pass --RTS=rtp-smp to the compiler driver
for linking.  The flag was not used during linking: the .spec files
named as linker options were all we passed for the linker to get the
-L flags for lib_smp and lib.

There was a problem, though: although /lib_smp/ and /lib/ were to be
searched in this order, and the specs files did that correctly, the
compiler would search /lib/ first regardless, because
STARTFILE_PREFIX_SPEC said so, and specs files cannot override that.

With this patch, we make sure the rtp-smp runtime causes -msmp to be
added to the command line passed to the compiler driver for linking,
and a corresponding patch for the ppc-vxworks configuration makes the
GCC compiler driver use this flag to select /lib_smp/ rather than
/lib/.

gcc/ada/

	* libgnat/system-vxworks-ppc-rtp-smp.ads: Add -msmp to
	Linker_Options pragma.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads b/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads
index d8c498fac7f..e4b80a8415e 100644
--- a/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads
+++ b/gcc/ada/libgnat/system-vxworks-ppc-rtp-smp.ads
@@ -120,6 +120,7 @@  package System is
 
 private
 
+   pragma Linker_Options ("-msmp");
    pragma Linker_Options ("--specs=vxworks-smp-ppc-link.spec");
    pragma Linker_Options ("--specs=vxworks-ppc-link.spec");
    --  Setup proper set of -L's for this configuration