From ed8be66086b0d2ffb1a7b175e968217633bfbbbb Mon Sep 17 00:00:00 2001 From: riastradh Date: Thu, 9 May 2013 23:35:29 +0000 Subject: [PATCH] Use --sysroot in cpp/gcc/gxx cross-compiler wrappers. Now that NetBSD supports --sysroot we don't need to mess with the partial measures of -nostdinc, -isystem, &c. ok agc --- mk/wrapper/cmd-sink-cross-cpp | 15 ++------- mk/wrapper/cmd-sink-cross-gcc | 39 ++-------------------- mk/wrapper/cmd-sink-cross-gxx | 61 ++--------------------------------- 3 files changed, 9 insertions(+), 106 deletions(-) diff --git a/mk/wrapper/cmd-sink-cross-cpp b/mk/wrapper/cmd-sink-cross-cpp index 62f69cef5e71..cc0654ffca8b 100644 --- a/mk/wrapper/cmd-sink-cross-cpp +++ b/mk/wrapper/cmd-sink-cross-cpp @@ -1,4 +1,4 @@ -# $NetBSD: cmd-sink-cross-cpp,v 1.1 2007/08/02 18:19:32 joerg Exp $ +# $NetBSD: cmd-sink-cross-cpp,v 1.2 2013/05/09 23:35:29 riastradh Exp $ # # Copyright (c) 2007 Joerg Sonnenberger . # All rights reserved. @@ -29,17 +29,8 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -# Don't use standard include path. -arg="-nostdinc" -$debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" -. $buildcmd - -# Compiler searches for headers in /usr/include, emulate. -arg="-isystem" -$debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" -. $buildcmd - -arg="@CROSS_DESTDIR@/usr/include" +# Use include files and libraries from the target system image. +arg="--sysroot=@CROSS_DESTDIR@" $debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" . $buildcmd diff --git a/mk/wrapper/cmd-sink-cross-gcc b/mk/wrapper/cmd-sink-cross-gcc index 1b0996f951a6..513b91b41273 100644 --- a/mk/wrapper/cmd-sink-cross-gcc +++ b/mk/wrapper/cmd-sink-cross-gcc @@ -1,4 +1,4 @@ -# $NetBSD: cmd-sink-cross-gcc,v 1.2 2007/10/09 19:19:13 martti Exp $ +# $NetBSD: cmd-sink-cross-gcc,v 1.3 2013/05/09 23:35:29 riastradh Exp $ # # Copyright (c) 2007 Joerg Sonnenberger . # All rights reserved. @@ -29,41 +29,8 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -if [ "${dont_link}" != yes ]; then - # Don't use standard search paths - arg="-Wl,-nostdlib" - $debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" - . $buildcmd - - # All normal library locations should be checked for - for libdir in /usr/lib @PREFIX@/lib; do - arg="-Wl,-rpath-link,@CROSS_DESTDIR@${libdir}" - $debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" - . $buildcmd - done - - # Compiler searches for libraries in /usr/lib, emulate. - arg="-L@CROSS_DESTDIR@/usr/lib" - $debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" - . $buildcmd - - # crt1.o and friends needs to be found as well. - arg="-B@CROSS_DESTDIR@/usr/lib" - $debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" - . $buildcmd -fi - -# Don't use standard include path. -arg="-nostdinc" -$debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" -. $buildcmd - -# Compiler searches for headers in /usr/include, emulate. -arg="-isystem" -$debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" -. $buildcmd - -arg="@CROSS_DESTDIR@/usr/include" +# Use include files and libraries from the target system image. +arg="--sysroot=@CROSS_DESTDIR@" $debug_log $wrapperlog " (cmd-sink-native-cc) pop: $arg" . $buildcmd diff --git a/mk/wrapper/cmd-sink-cross-gxx b/mk/wrapper/cmd-sink-cross-gxx index 313b31b0bb69..15f88ca577c1 100644 --- a/mk/wrapper/cmd-sink-cross-gxx +++ b/mk/wrapper/cmd-sink-cross-gxx @@ -1,4 +1,4 @@ -# $NetBSD: cmd-sink-cross-gxx,v 1.1 2011/08/04 13:32:05 obache Exp $ +# $NetBSD: cmd-sink-cross-gxx,v 1.2 2013/05/09 23:35:29 riastradh Exp $ # # Copyright (c) 2007 Joerg Sonnenberger . # All rights reserved. @@ -29,63 +29,8 @@ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -if [ "${dont_link}" != yes ]; then - # Don't use standard search paths - arg="-Wl,-nostdlib" - $debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" - . $buildcmd - - # All normal library locations should be checked for - for libdir in /usr/lib @PREFIX@/lib; do - arg="-Wl,-rpath-link,@CROSS_DESTDIR@${libdir}" - $debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" - . $buildcmd - done - - # Compiler searches for libraries in /usr/lib, emulate. - arg="-L@CROSS_DESTDIR@/usr/lib" - $debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" - . $buildcmd - - # crt1.o and friends needs to be found as well. - arg="-B@CROSS_DESTDIR@/usr/lib" - $debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" - . $buildcmd -fi - -# Don't use standard include path. -arg="-nostdinc" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -# Compiler searches for headers in /usr/include, emulate. -arg="-isystem" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -arg="@CROSS_DESTDIR@/usr/include" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -# Don't use standard include path. -arg="-nostdinc++" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -# Compiler searches for headers in /usr/include/g++, emulate. -arg="-isystem" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -arg="@CROSS_DESTDIR@/usr/include/g++" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -arg="-isystem" -$debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" -. $buildcmd - -arg="@CROSS_DESTDIR@/usr/include/g++/backward" +# Use include files and libraries from the target system image. +arg="--sysroot=@CROSS_DESTDIR@" $debug_log $wrapperlog " (cmd-sink-native-cxx) pop: $arg" . $buildcmd