Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added hack for GCC spec files.

  • Loading branch information...
commit cbec3dcd5814a26de8b948d264791542fa2a55e5 1 parent e8fa8a9
@Cryolite authored
View
4 gcc/jamfile
@@ -628,7 +628,9 @@ actions make-install
# Install the wrapper scripts.
- install --mode=755 "$(INTRO_ROOT_DIR)/gcc/gcc-wrapper" "$(INTRO_ROOT_DIR)/gcc/g++-wrapper" "$(COMPILER_PREFIX)/bin"
+ install --mode=755 "$(INTRO_ROOT_DIR)/template/$(TRIPLET)/gcc-wrapper" "$(COMPILER_PREFIX)/bin" \
+ && install --mode=755 "$(INTRO_ROOT_DIR)/template/$(TRIPLET)/g++-wrapper" "$(COMPILER_PREFIX)/bin" \
+ && install --mode=755 "$(INTRO_ROOT_DIR)/template/$(TRIPLET)/hack-gcc-specs" "$(COMPILER_PREFIX)/bin"
if [ $? -ne 0 ]; then
echo "ERROR: failed to install the wrapper scripts for $(COMPILER_DESCRIPTION) ($(TRIPLET))." 1>&2
echo -n "ERROR: failed to install the wrapper scripts for $(COMPILER_DESCRIPTION) ($(TRIPLET))." | $(AWACS)
View
62 template/x86_64-unknown-linux-gnu/g++-wrapper
@@ -0,0 +1,62 @@
+#! /bin/sh
+
+if ! which dirname 1>/dev/null 2>&1; then
+ echo "$0: error: dirname: command not found" >&2
+ exit 1
+fi
+
+if ! which pwd 1>/dev/null 2>&1; then
+ echo "$0: error: pwd: command not found" >&2
+ exit 1
+fi
+
+bindir=`(cd \`dirname "$0"\`; pwd)`
+dir=`dirname "$bindir"`
+libdir="$dir/lib"
+
+if ! which uname 1>/dev/null 2>&1; then
+ echo "$0: error: uname: command not found" >&2
+ exit 1
+fi
+
+if ! which grep 1>/dev/null 2>&1; then
+ echo "$0: error: grep: command not found" >&2
+ exit 1
+fi
+
+if uname | grep -Fq 'Linux'; then
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}$libdir"
+ export LD_LIBRARY_PATH
+elif uname | grep -Fq 'CYGWIN'; then
+ PATH="${PATH:+${PATH}:}$bindir"
+ export PATH
+else
+ echo "$0: error: unknown system" >&2
+ exit 1
+fi
+
+if ! which mktemp 1>/dev/null 2>&1; then
+ echo "$0: error: mktemp: command not found" >&2
+ exit 1
+fi
+
+if ! which "$bindir/hack-gcc-specs" >/dev/null 2>&1; then
+ echo "$0: error: $bindir/hack-gcc-specs: command not found" >&2
+ exit 1
+fi
+
+if ! which "$bindir/g++" 1>/dev/null 2>&1; then
+ echo "$0: error: $bindir/g++: command not found" >&2
+ exit 1
+fi
+
+specs=`mktemp` || exit
+
+"$bindir/hack-gcc-specs" > "$specs" || exit
+
+"$bindir/g++" -specs="$specs" "$@" -Wl,-rpath="$libdir"
+result=$?
+
+rm -f "$specs"
+
+exit $result
View
62 template/x86_64-unknown-linux-gnu/gcc-wrapper
@@ -0,0 +1,62 @@
+#! /bin/sh
+
+if ! which dirname 1>/dev/null 2>&1; then
+ echo "$0: error: dirname: command not found" >&2
+ exit 1
+fi
+
+if ! which pwd 1>/dev/null 2>&1; then
+ echo "$0: error: pwd: command not found" >&2
+ exit 1
+fi
+
+bindir=`(cd \`dirname "$0"\`; pwd)`
+dir=`dirname "$bindir"`
+libdir="$dir/lib"
+
+if ! which uname 1>/dev/null 2>&1; then
+ echo "$0: error: uname: command not found" >&2
+ exit 1
+fi
+
+if ! which grep 1>/dev/null 2>&1; then
+ echo "$0: error: grep: command not found" >&2
+ exit 1
+fi
+
+if uname | grep -Fq 'Linux'; then
+ LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}$libdir"
+ export LD_LIBRARY_PATH
+elif uname | grep -Fq 'CYGWIN'; then
+ PATH="${PATH:+${PATH}:}$bindir"
+ export PATH
+else
+ echo "$0: error: unknown system" >&2
+ exit 1
+fi
+
+if ! which mktemp 1>/dev/null 2>&1; then
+ echo "$0: error: mktemp: command not found" >&2
+ exit 1
+fi
+
+if ! which "$bindir/hack-gcc-specs" >/dev/null 2>&1; then
+ echo "$0: error: $bindir/hack-gcc-specs: command not found" >&2
+ exit 1
+fi
+
+if ! which "$bindir/g++" 1>/dev/null 2>&1; then
+ echo "$0: error: $bindir/g++: command not found" >&2
+ exit 1
+fi
+
+specs=`mktemp` || exit
+
+"$bindir/hack-gcc-specs" > "$specs" || exit
+
+"$bindir/gcc" -specs="$specs" "$@" -Wl,-rpath="$libdir"
+result=$?
+
+rm -f "$specs"
+
+exit $result
View
112 template/x86_64-unknown-linux-gnu/hack-gcc-specs
@@ -0,0 +1,112 @@
+#! /bin/sh
+
+if ! which dirname 1>/dev/null 2>&1; then
+ echo "$0: error: dirname: command not found" >&2
+ exit 1
+fi
+if ! which pwd 1>/dev/null 2>&1; then
+ echo "$0: error: pwd: command not found" >&2
+ exit 1
+fi
+
+bindir=`(cd \`dirname "$0"\`; pwd)`
+libdir="`dirname "$bindir"`/lib"
+
+if ! which "$bindir/g++-wrapper" 1>/dev/null 2>&1; then
+ echo "$0: error: $bindir/g++-wrapper: command not found" >&2
+ exit 1
+fi
+
+specs=`"$bindir/gcc" -dumpspecs`
+
+if ! which sed 1>/dev/null 2>&1; then
+ echo "$0: error: sed: command not found" >&2
+ exit 1
+fi
+
+
+cpp_options_prologue=`echo "$specs" | sed '/^\*cpp_options:$/q'`
+cpp_options_epilogue=`echo "$specs" | sed '1,/^\*cpp_options:$/d'`
+cpp_options=`echo "$cpp_options_epilogue" | sed '1q'`
+cpp_options_epilogue=`echo "$cpp_options_epilogue" | sed -n '2,$p'`
+
+if ! echo "$cpp_options" | grep -Fq ' %{f*} '; then
+ echo "$0: error: cannot hack GCC spec file" >&2
+ exit 1
+fi
+cpp_options=`echo "$cpp_options" | sed 's/ %{f\*} / %{f*} %{fmudflap:%{pthread:-fmudflapth}} /'`
+specs=`echo "$cpp_options_prologue
+$cpp_options
+$cpp_options_epilogue"`
+
+
+cpp_unique_options_prologue=`echo "$specs" | sed '/^\*cpp_unique_options:$/q'`
+cpp_unique_options_epilogue=`echo "$specs" | sed '1,/^\*cpp_unique_options:$/d'`
+cpp_unique_options=`echo "$cpp_unique_options_epilogue" | sed '1q'`
+cpp_unique_options_epilogue=`echo "$cpp_unique_options_epilogue" | sed -n '2,$p'`
+
+if ! echo "$cpp_unique_options" | grep -Fq ' %{fmudflap:-D_MUDFLAP -include mf-runtime.h} '; then
+ echo "$0: error: cannot hack GCC spec file" >&2
+ exit 1
+fi
+cpp_unique_options=`echo "$cpp_unique_options" \
+ | sed 's/ %{fmudflap:-D_MUDFLAP -include mf-runtime\.h} / %{fmudflap:-D_MUDFLAP %{pthread:-D_MUDFLAPTH} -include mf-runtime.h} /'`
+specs=`echo "$cpp_unique_options_prologue
+$cpp_unique_options
+$cpp_unique_options_epilogue"`
+
+
+cc1_options_prologue=`echo "$specs" | sed '/^\*cc1_options:$/q'`
+cc1_options_epilogue=`echo "$specs" | sed '1,/^\*cc1_options:$/d'`
+cc1_options=`echo "$cc1_options_epilogue" | sed '1q'`
+cc1_options_epilogue=`echo "$cc1_options_epilogue" | sed -n '2,$p'`
+
+if ! echo "$cc1_options" | grep -Fq ' %{f*} '; then
+ echo "$0: error: cannot hack GCC spec file" >&2
+ exit 1
+fi
+cc1_options=`echo "$cc1_options" \
+ | sed 's/\(.*\)/%{fmudflap|fmudflapth:%{fpic|fPIC:%e-fmudflap or -fmudflapth is not compatible with -fpic or -fPIC}} \1/' \
+ | sed 's/ %{f\*} / %{f*} %{fmudflap:%{pthread:-fmudflapth}} /'`
+specs=`echo "$cc1_options_prologue
+$cc1_options
+$cc1_options_epilogue"`
+
+
+mfwrap_prologue=`echo "$specs" | sed '/^\*mfwrap:$/q'`
+mfwrap_epilogue=`echo "$specs" | sed '1,/^\*mfwrap:$/d'`
+mfwrap=`echo "$mfwrap_epilogue" | sed '1q'`
+mfwrap_epilogue=`echo "$mfwrap_epilogue" | sed -n '2,$p'`
+
+if ! echo "$mfwrap" | grep -Fq '%{fmudflapth: --wrap=pthread_create}'; then
+ echo "$0: error: cannot hack GCC spec file" >&2
+ exit 1
+fi
+mfwrap=`echo "$mfwrap" \
+ | sed 's/%{fmudflapth: --wrap=pthread_create}/%{fmudflap:%{pthread: --wrap=pthread_create}} %{fmudflapth: --wrap=pthread_create}/'`
+specs=`echo "$mfwrap_prologue
+$mfwrap
+$mfwrap_epilogue"`
+
+
+link_command_prologue=`echo "$specs" | sed '/^\*link_command:$/q'`
+link_command_epilogue=`echo "$specs" | sed '1,/^\*link_command:$/d'`
+link_command=`echo "$link_command_epilogue" | sed '1q'`
+link_command_epilogue=`echo "$link_command_epilogue" | sed -n '2,$p'`
+
+if ! echo "$link_command" | grep -Fq ' %(linker) '; then
+ echo "$0: error: cannot hack GCC spec file" >&2
+ exit 1
+fi
+if ! echo "$link_command" | grep -Fq ' %o '; then
+ echo "$0: error: cannot hack GCC spec file" >&2
+ exit 1
+fi
+link_command=`echo "$link_command" \
+ | sed 's/ %o / %o %{fmudflap:%{!fmudflapth:%{pthread:-lmudflapth;:-lmudflap}}} %{fmudflapth:-lmudflapth} /'`
+specs=`echo "$link_command_prologue
+$link_command
+$link_command_epilogue"`
+
+
+echo "$specs"
View
16 template/x86_64-unknown-linux-gnu/site-config.jam
@@ -912,22 +912,6 @@ feature.compose <libstdc++-debug-mode>on
<define>_GLIBCXX_DEBUG_PEDANTIC
;
-feature.feature libstdc++-debug-binary
- : off on
- : propagated composite
- ;
-feature.compose <libstdc++-debug-binary>on
- : <linkflags>-Sdebug-libstdc++
- ;
-
-feature.feature libstdc++-link
- : shared static
- : propagated composite
- ;
-feature.compose <libstdc++-link>static
- : <linkflags>-Sstatic-libstdc++
- ;
-
feature.feature mudflap
: off on
: propagated composite
Please sign in to comment.
Something went wrong with that request. Please try again.