@@ -116,3 +116,25 @@ target_prefix ?= "${prefix}"
# The real WORKDIR location isn't a dependency for the shared workdir.
src_patches[vardepsexclude] = "WORKDIR"
should_apply[vardepsexclude] += "PN"
+
+remove_sysroot_paths_from_configargs () {
+ replacement=${1}
+ # Prevent sysroot path from being used in configargs.h header, as it will
+ # be rewritten when used by other sysroots preventing support for gcc
+ # plugins. Additionally the path is embeddeded into the output binary, this
+ # prevents building a reproducible binary.
+ oe_runmake configure-gcc
+ sed -i "s@${STAGING_DIR_TARGET}@$replacement@g" ${B}/gcc/configargs.h
+ sed -i "s@${STAGING_DIR_HOST}@/$replacement@g" ${B}/gcc/configargs.h
+}
+
+remove_sysroot_paths_from_checksum_options () {
+ stagingdir=${1}
+ replacement=${2}
+ # Prevent sysroot/workdir paths from being used in checksum-options.
+ # checksum-options is used to generate a checksum which is embedded into
+ # the output binary.
+ oe_runmake TARGET-gcc=checksum-options all-gcc
+ sed -i "s@${DEBUG_PREFIX_MAP}@@g" ${B}/gcc/checksum-options
+ sed -i "s@$stagingdir@$replacement@g" ${B}/gcc/checksum-options
+}
@@ -119,4 +119,3 @@ do_configure () {
oe_runconf
}
-
@@ -63,6 +63,9 @@ do_configure () {
}
do_compile () {
+ remove_sysroot_paths_from_configargs '/host'
+ remove_sysroot_paths_from_checksum_options '${STAGING_DIR_HOST}' '/host'
+
oe_runmake all-host configure-target-libgcc
(cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
}
@@ -61,19 +61,8 @@ do_compile () {
export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
- # Prevent native/host sysroot path from being used in configargs.h header,
- # as it will be rewritten when used by other sysroots preventing support
- # for gcc plugins
- oe_runmake configure-gcc
- sed -i 's@${STAGING_DIR_TARGET}@/host@g' ${B}/gcc/configargs.h
- sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/configargs.h
-
- # Prevent sysroot/workdir paths from being used in checksum-options.
- # checksum-options is used to generate a checksum which is embedded into
- # the output binary.
- oe_runmake TARGET-gcc=checksum-options all-gcc
- sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
- sed -i 's@${STAGING_DIR_HOST}@/host@g' ${B}/gcc/checksum-options
+ remove_sysroot_paths_from_configargs '/host'
+ remove_sysroot_paths_from_checksum_options '${STAGING_DIR_HOST}' '/host'
oe_runmake all-host configure-target-libgcc
(cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
@@ -140,20 +140,8 @@ FILES:${PN}-doc = "\
"
do_compile () {
- # Prevent full target sysroot path from being used in configargs.h header,
- # as it will be rewritten when used by other sysroots preventing support
- # for gcc plugins. Additionally the path is embeddeded into the output
- # binary, this prevents building a reproducible binary.
- oe_runmake configure-gcc
- sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/configargs.h
- sed -i 's@${STAGING_DIR_HOST}@/@g' ${B}/gcc/configargs.h
-
- # Prevent sysroot/workdir paths from being used in checksum-options.
- # checksum-options is used to generate a checksum which is embedded into
- # the output binary.
- oe_runmake TARGET-gcc=checksum-options all-gcc
- sed -i 's@${DEBUG_PREFIX_MAP}@@g' ${B}/gcc/checksum-options
- sed -i 's@${STAGING_DIR_TARGET}@/@g' ${B}/gcc/checksum-options
+ remove_sysroot_paths_from_configargs '/'
+ remove_sysroot_paths_from_checksum_options '${STAGING_DIR_TARGET}' '/'
oe_runmake all-host
}