tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wrappers and gcc -isystem



On 18/02/16 22:37, Jonathan Perkin wrote:
* On 2016-02-17 at 11:15 GMT, Jonathan Perkin wrote:

+1 on removing -isystem completely.

I tested adding a BUILDLINK_TRANSFORM for -isystem => -I in a bulk
build, the result is here:

Certainly thats a simple fix, but I'm curious how its results compare to teaching the wrapper framework fully about -isystem
which as far as I can tell is the below patch.

I'm not philosophically inclined to either approach, just being able to
simply and repeatedly build packages.

cheers
mark

Index: buildlink3/bsd.buildlink3.mk
===================================================================
RCS file: /src/cvs/netbsd/pkgsrc/mk/buildlink3/bsd.buildlink3.mk,v
retrieving revision 1.236
diff -u -r1.236 bsd.buildlink3.mk
--- buildlink3/bsd.buildlink3.mk	4 May 2015 19:23:19 -0000	1.236
+++ buildlink3/bsd.buildlink3.mk	18 Feb 2016 09:39:10 -0000
@@ -968,6 +968,7 @@
 #
 .for _dir_ in ${COMPILER_INCLUDE_DIRS}
 _BLNK_TRANSFORM+=	opt-sub:-I${_dir_}:-I${_BLNK_MANGLE_DIR.${_dir_}}
+_BLNK_TRANSFORM+=	opt-sub:-isystem,${_dir_}:-isystem,${_BLNK_MANGLE_DIR.${_dir_}}
 _CWRAPPERS_TRANSFORM+=	I:${_dir_}:${_dir_}
 .endfor
 .for _dir_ in ${COMPILER_LIB_DIRS}
Index: wrapper/arg-source
===================================================================
RCS file: /src/cvs/netbsd/pkgsrc/mk/wrapper/arg-source,v
retrieving revision 1.16
diff -u -r1.16 arg-source
--- wrapper/arg-source	20 Nov 2015 05:49:24 -0000	1.16
+++ wrapper/arg-source	1 Feb 2016 18:51:04 -0000
@@ -61,6 +61,18 @@
 		$debug_log $wrapperlog "    (arg-source) push: $arg$nextarg"
 		;;
 	##############################################################
+	# Convert "-isystem /dir" into a single "-isystem,/dir".
+	# cmd-sync will put it back
+	##############################################################
+	-isystem)
+		nextarg="$1"; shift
+		case "$nextarg" in
+		-*) msg_log $wrapperlog "WARNING: [arg-source] An $arg option must not be followed by another option, $nextarg." ;;
+		esac
+		append_queue argbuf "$arg,$nextarg"
+		$debug_log $wrapperlog "    (arg-source) push: $arg,$nextarg"
+		;;
+	##############################################################
 	# Split -Wl,option1,option2 into -Wl,option1 -Wl,option2 and
 	# process them again.
 	#
Index: wrapper/cmd-sink
===================================================================
RCS file: /src/cvs/netbsd/pkgsrc/mk/wrapper/cmd-sink,v
retrieving revision 1.1
diff -u -r1.1 cmd-sink
--- wrapper/cmd-sink	21 Sep 2004 15:01:41 -0000	1.1
+++ wrapper/cmd-sink	1 Feb 2016 18:28:55 -0000
@@ -38,5 +38,13 @@
 while ! queue_is_empty cmdbuf; do
 	pop_queue cmdbuf arg
 	$debug_log $wrapperlog "    (cmd-sink) pop: $arg"
+	case $arg in
+	-isystem,*)
+		dir="${arg#-isystem,}"
+		arg="-isystem"
+		. $buildcmd
+		arg="$dir"
+		;;
+	esac
 	. $buildcmd
 done
Index: wrapper/gen-transform.sh
===================================================================
RCS file: /src/cvs/netbsd/pkgsrc/mk/wrapper/gen-transform.sh,v
retrieving revision 1.10
diff -u -r1.10 gen-transform.sh
--- wrapper/gen-transform.sh	30 Dec 2014 15:13:20 -0000	1.10
+++ wrapper/gen-transform.sh	18 Feb 2016 09:51:28 -0000
@@ -81,12 +81,16 @@
 		transform)
 			$debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
 			gen $_action "opt:-I$1:-I$2"
+			gen $_action "opt:-isystem,$1:-isystem,$2"
 			gen $_action "opt-sub:-I$1:-I$2"
+			gen $_action "opt-sub:-isystem,$1:-isystem,$2"
 			;;
 		untransform)
 			$debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
 			gen $_action "opt:-I$2:-I$1"
+			gen $_action "opt:-isystem,$2:-isystem,$1"
 			gen $_action "opt-sub:-I$2:-I$1"
+			gen $_action "opt-sub:-isystem,$2:-isystem,$1"
 			;;
 		esac
 		;;
@@ -161,6 +165,7 @@
 		$debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
 		#gen $_action "opt:$1:$2"
 		gen $_action "opt:-I$1:-I$2"
+		gen $_action "opt:-isystem,$1:-isystem,$2"
 		gen $_action "opt:-L$1:-L$2"
 		gen $_action "rpath-exact:$1:$2"
 		gen $_action "sub-mangle:$1:$2"
@@ -172,6 +177,7 @@
 	no-abspath)
 		$debug_log $wrapperlog "   (gen-transform) $_cmd"
 		gen $_action "rm-optarg:-I/"
+		gen $_action "rm-optarg:-isystem,/"
 		gen $_action "rm-optarg:-L/"
 		for _R in $rpath_options; do
 			gen $_action "rm-optarg:$_R/"
@@ -303,7 +309,9 @@
 	rmdir)
 		$debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
 		gen $_action "opt:-I$1:"
+		gen $_action "opt:-isystem,$1:"
 		gen $_action "rm-optarg:-I$1/"
+		gen $_action "rm-optarg:-isystem,$1/"
 		gen $_action "opt:-L$1:"
 		gen $_action "rm-optarg:-L$1/"
 		for _R in $rpath_options; do
@@ -340,6 +348,7 @@
 		$debug_log $wrapperlog "   (gen-transform) $_cmd: $@"
 		gen $_action "opt-sub-trailer:$1:/\.:$1:"
 		gen $_action "opt-sub-trailer:-I$1:/\.:-I$1:"
+		gen $_action "opt-sub-trailer:-isystem,$1:/\.:-isystem,$1:"
 		gen $_action "opt-sub-trailer:-L$1:/\.:-L$1:"
 		for _R in $rpath_options; do
 			gen $_action "opt-sub-trailer:$_R$1:/\.:$_R$1:"
@@ -355,6 +364,7 @@
 		#gen $_action "opt-sub:$1:$2"
 		gen $_action "libpath:$1:$2"
 		gen $_action "opt-sub:-I$1:-I$2"
+		gen $_action "opt-sub:-isystem,$1:-isystem,$2"
 		gen $_action "opt-sub:-L$1:-L$2"
 		gen $_action "sub-rpath:$1:$2"
 		;;
Index: wrapper/transform-gcc
===================================================================
RCS file: /src/cvs/netbsd/pkgsrc/mk/wrapper/transform-gcc,v
retrieving revision 1.29
diff -u -r1.29 transform-gcc
--- wrapper/transform-gcc	31 Dec 2013 13:56:35 -0000	1.29
+++ wrapper/transform-gcc	1 Feb 2016 18:44:58 -0000
@@ -52,6 +52,7 @@
 -fweb			|\
 -fwrapv			|\
 -ggdb			|\
+-isystem,*		|\
 -M			|\
 -M[DFMPT]		|\
 -MMD			|\
 


Home | Main Index | Thread Index | Old Index