* [PATCH 1 of 4] configure: disable static linking on Darwin
2011-06-27 21:40 [PATCH 0 of 4] No static link on Darwin + new gcc options Yann E. MORIN
@ 2011-06-27 21:40 ` Yann E. MORIN
2011-06-27 21:40 ` [PATCH 2 of 4] cc/gcc: add build-id option Yann E. MORIN
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2011-06-27 21:40 UTC (permalink / raw)
To: crossgcc; +Cc: Bryan Hundven, Titus von Boxberg
# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
# Date 1309201420 -7200
# Node ID 28ea242a652e197abf84c549ee275059a425d72a
# Parent 364b06df9e3a11637489a8f3f6a0010a555a5597
configure: disable static linking on Darwin
Static liunking is not supported on Darwin, so hide the corresponding
options when the build machine is Darwin.
Reported-by: Andrea Franceschini <therealmorpheu5@gmail.com>
Reported-by: Bryan Hundven <bryanhundven@gmail.com>
Reported-by: "Titus von Boxberg" <titus@v9g.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -44,6 +44,7 @@
bool
prompt "Link libstdc++ statically into the gcc binary"
default y
+ depends on CONFIGURE_static_link_ok
depends on CONFIGURE_has_static_libstdcxx
depends on CC_GCC_4_4_or_later
help
diff --git a/config/debug/gdb.in.cross b/config/debug/gdb.in.cross
--- a/config/debug/gdb.in.cross
+++ b/config/debug/gdb.in.cross
@@ -24,6 +24,7 @@
config GDB_CROSS_STATIC
bool
prompt "Build a static cross gdb"
+ depends on CONFIGURE_static_link_ok
depends on CONFIGURE_has_static_expat
help
A static cross gdb can be usefull if you debug on a machine that is
diff --git a/config/toolchain.in b/config/toolchain.in
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -51,6 +51,7 @@
config STATIC_TOOLCHAIN_POSSIBLE
bool
default y
+ depends on CONFIGURE_static_link_ok
depends on CONFIGURE_has_static_libstdcxx
# Add new deps here! :-)
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -435,6 +435,29 @@
has_or_abort prog=readelf var=readelf
has_or_abort prog=patch var=patch
+# System specific checks
+printf "Checking if static linking is possible... "
+static_link_ok=""
+case $(uname -s) in
+ Darwin) ;;
+ *) if gcc -xc - -static -o - >/dev/null 2>&1<<-_EOF_
+ int main() { return 0; }
+ _EOF_
+ then
+ static_link_ok="y"
+ fi
+ ;;
+esac
+if [ "${static_link_ok}" = "y" ]; then
+ printf "yes\n"
+else
+ printf "no\n"
+ printf " * An optional dependency is missing, some features will be disabled\n"
+ printf " * It wil not be possible to link binaries statically\n"
+fi
+add_to_kconfig_list static_link_ok
+
+# Library checks
ncurses_hdrs="ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h"
ncurses_libs="$( for l in ncursesw ncurses curses; do \
for x in so a dylib; do \
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2 of 4] cc/gcc: add build-id option
2011-06-27 21:40 [PATCH 0 of 4] No static link on Darwin + new gcc options Yann E. MORIN
2011-06-27 21:40 ` [PATCH 1 of 4] configure: disable static linking on Darwin Yann E. MORIN
@ 2011-06-27 21:40 ` Yann E. MORIN
2011-06-27 21:40 ` [PATCH 3 of 4] cc/gcc: add option for linker hash style Yann E. MORIN
2011-06-27 21:48 ` [PATCH 4 of 4] cc/gcc: add MIPS spercific configure options Yann E. MORIN
3 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2011-06-27 21:40 UTC (permalink / raw)
To: crossgcc; +Cc: Bryan Hundven, Titus von Boxberg
# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
# Date 1309175535 -7200
# Node ID bf2d0ee90afdc4878d5e398470833dc7caeb3bd6
# Parent 28ea242a652e197abf84c549ee275059a425d72a
cc/gcc: add build-id option
Add an option to configure gcc with --enable-linker-build-id.
Reported-by: Bryan Hundven <bryanhundven@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -220,6 +220,7 @@
select CC_GCC_HAS_GRAPHITE
select CC_GCC_HAS_LTO
select CC_GCC_HAS_PKGVERSION_BUGURL
+ select CC_GCC_HAS_BUILD_ID
config CC_GCC_4_5_or_later
bool
@@ -233,6 +234,7 @@
select CC_GCC_HAS_GRAPHITE
select CC_GCC_HAS_LTO
select CC_GCC_HAS_PKGVERSION_BUGURL
+ select CC_GCC_HAS_BUILD_ID
config CC_GCC_4_6_or_later
bool
@@ -255,6 +257,9 @@
config CC_GCC_HAS_PKGVERSION_BUGURL
bool
+config CC_GCC_HAS_BUILD_ID
+ bool
+
# Only enable gcc's support for plugins if binutils has it as well
# They are usefull only when doing LTO, but it does no harm enabling
# them even without LTO.
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -199,3 +199,16 @@
glibc >= 2.4, 64-bit otherwise)
If in doubt, keep the default, ie. 'M'.
+
+config CC_GCC_BUILD_ID
+ bool
+ prompt "Enable build-id"
+ depends on CC_GCC_HAS_BUILD_ID
+ help
+ Tells GCC to pass --build-id option to the linker for all final
+ links (links performed without the -r or --relocatable option),
+ if the linker supports it. If you say 'y' here, but your linker
+ does not support --build-id option, a warning is issued and this
+ option is ignored.
+
+ The default is off.
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -258,6 +258,10 @@
"") extra_config+=("--without-long-double-128");;
esac
+ if [ "${CT_CC_GCC_BUILD_ID}" = "y" ]; then
+ extra_config+=( --enable-linker-build-id )
+ fi
+
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
# Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
@@ -527,6 +531,10 @@
"") extra_config+=("--without-long-double-128");;
esac
+ if [ "${CT_CC_GCC_BUILD_ID}" = "y" ]; then
+ extra_config+=( --enable-linker-build-id )
+ fi
+
if [ "${CT_CC_GCC_ENABLE_PLUGINS}" = "y" ]; then
extra_config+=( --enable-plugin )
fi
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3 of 4] cc/gcc: add option for linker hash style
2011-06-27 21:40 [PATCH 0 of 4] No static link on Darwin + new gcc options Yann E. MORIN
2011-06-27 21:40 ` [PATCH 1 of 4] configure: disable static linking on Darwin Yann E. MORIN
2011-06-27 21:40 ` [PATCH 2 of 4] cc/gcc: add build-id option Yann E. MORIN
@ 2011-06-27 21:40 ` Yann E. MORIN
2011-06-27 21:48 ` [PATCH 4 of 4] cc/gcc: add MIPS spercific configure options Yann E. MORIN
3 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2011-06-27 21:40 UTC (permalink / raw)
To: crossgcc; +Cc: Bryan Hundven, Titus von Boxberg
# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
# Date 1309180500 -7200
# Node ID 9d62710aa7ce46782da2cc122477b5350ca7c82b
# Parent bf2d0ee90afdc4878d5e398470833dc7caeb3bd6
cc/gcc: add option for linker hash style
Add an option to specify the hash type that gcc will ask the linker to use.
It is a provision for the upcoming 4.7, as no version currently supports it.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -260,6 +260,11 @@
config CC_GCC_HAS_BUILD_ID
bool
+# For the upcoming 4.7 ?
+# None have linker-hash-style support for now...
+config CC_GCC_HAS_LNK_HASH_STYLE
+ bool
+
# Only enable gcc's support for plugins if binutils has it as well
# They are usefull only when doing LTO, but it does no harm enabling
# them even without LTO.
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -212,3 +212,41 @@
option is ignored.
The default is off.
+
+choice CC_GCC_LNK_HASH_STYLE_CHOICE
+ bool
+ prompt "linker hash style"
+ depends on CC_GCC_HAS_LNK_HASH_STYLE
+
+config CC_GCC_LNK_HASH_STYLE_DEFAULT
+ bool
+ prompt "Default"
+ help
+ Do not specify any value, and use the default value (sysv).
+
+config CC_GCC_LNK_HASH_STYLE_SYSV
+ bool
+ prompt "sysv"
+ help
+ Force use of the SYSV hash style.
+
+config CC_GCC_LNK_HASH_STYLE_GNU
+ bool
+ prompt "gnu"
+ help
+ Force use of the GNU hash style.
+
+config CC_GCC_LNK_HASH_STYLE_BOTH
+ bool
+ prompt "both"
+ help
+ Force use of both hash styles.
+
+endchoice # CC_GCC_LNK_HASH_STYLE_CHOICE
+
+config CC_GCC_LNK_HASH_STYLE
+ string
+ default "" if CC_GCC_LNK_HASH_STYLE_DEFAULT
+ default "sysv" if CC_GCC_LNK_HASH_STYLE_SYSV
+ default "gnu" if CC_GCC_LNK_HASH_STYLE_GNU
+ default "both" if CC_GCC_LNK_HASH_STYLE_BOTH
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -262,6 +262,11 @@
extra_config+=( --enable-linker-build-id )
fi
+ case "${CT_CC_GCC_LNK_HASH_STYLE}" in
+ "") ;
+ *) extra_config+=( "--with-linker-hash-style=${CT_CC_GCC_LNK_HASH_STYLE}" );;
+ esac
+
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
# Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
@@ -535,6 +540,11 @@
extra_config+=( --enable-linker-build-id )
fi
+ case "${CT_CC_GCC_LNK_HASH_STYLE}" in
+ "") ;
+ *) extra_config+=( "--with-linker-hash-style=${CT_CC_GCC_LNK_HASH_STYLE}" );;
+ esac
+
if [ "${CT_CC_GCC_ENABLE_PLUGINS}" = "y" ]; then
extra_config+=( --enable-plugin )
fi
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0 of 4] No static link on Darwin + new gcc options
@ 2011-06-27 21:40 Yann E. MORIN
2011-06-27 21:40 ` [PATCH 1 of 4] configure: disable static linking on Darwin Yann E. MORIN
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Yann E. MORIN @ 2011-06-27 21:40 UTC (permalink / raw)
To: crossgcc; +Cc: Bryan Hundven, Titus von Boxberg
Hello All!
Here are a few patches that:
- disable static linking on Darwin:
- it does not work
- it is not supported either
- add a few new options to gcc:
- pass build-id to the linker
- pass hash-style to the linker (not used, requires upcoming 4.7)
- use a few MIPS-related configure options
Titus, Bryan, can you confirm about the first patch? Thx.
Titus, you'd probably be interested only in the first patch, but I
sent it all as a single series, sorry for the noise.
b/config/cc/gcc.in.2 | 64 64 0 0 ++++++++++++++++++++++++++++++++++++++++++++
b/config/debug/gdb.in.cross | 1 1 0 0 +
b/config/toolchain.in | 1 1 0 0 +
b/configure | 23 23 0 0 ++++++++++++++++
b/config/cc/gcc.in | 10 10 0 0 +++++++
b/scripts/build/cc/gcc.sh | 50 50 0 0 ++++++++++++++++++++++++++++++++++
b/config/cc/gcc.in.mips | 34 34 0 0 +++++++++++++++++++++++
7 files changed, 183 insertions(+)
Regards,
Yann E. MORIN.
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4 of 4] cc/gcc: add MIPS spercific configure options
2011-06-27 21:40 [PATCH 0 of 4] No static link on Darwin + new gcc options Yann E. MORIN
` (2 preceding siblings ...)
2011-06-27 21:40 ` [PATCH 3 of 4] cc/gcc: add option for linker hash style Yann E. MORIN
@ 2011-06-27 21:48 ` Yann E. MORIN
3 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2011-06-27 21:48 UTC (permalink / raw)
To: crossgcc; +Cc: Bryan Hundven, Titus von Boxberg
# HG changeset patch
# User "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
# Date 1309190690 -7200
# Node ID c412d5cc58402ebcd12fa44a3d1b65fa96e2953d
# Parent 9d62710aa7ce46782da2cc122477b5350ca7c82b
cc/gcc: add MIPS spercific configure options
Add the following MIPS specific options when configuring gcc:
--with(out)-llsc
--with(out)-synci
--with(out)-mips-plt
--with-divide=type
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -250,3 +250,15 @@
default "sysv" if CC_GCC_LNK_HASH_STYLE_SYSV
default "gnu" if CC_GCC_LNK_HASH_STYLE_GNU
default "both" if CC_GCC_LNK_HASH_STYLE_BOTH
+
+#-----------------------------------------------------------------------------
+
+config CC_GCC_HAS_ARCH_OPTIONS
+ bool
+
+comment "archictecture-specific options"
+ depends on CC_GCC_HAS_ARCH_OPTIONS
+
+if ARCH_mips
+source "config/cc/gcc.in.mips"
+endif # ARCH_mips
diff --git a/config/cc/gcc.in.mips b/config/cc/gcc.in.mips
new file mode 100644
--- /dev/null
+++ b/config/cc/gcc.in.mips
@@ -0,0 +1,34 @@
+# MIPS specific options for gcc
+
+config CC_GCC_HAS_ARCH_OPTIONS
+ default y
+
+config CC_GCC_mips_llsc
+ tristate
+ prompt "Use llsc"
+ default m
+ help
+ This configures how gcc will emit load-lock and store-conditional
+ opcodes. Normally, you'd set this to 'M', and configure will do the
+ correct thing (ie. enable llsc for Linux-based targets, disable for
+ others). If you know better, you can force either using llsc or not
+ using it (resp. 'Y' or 'N').
+
+config CC_GCC_mips_synci
+ tristate
+ prompt "Use synci"
+ default m
+ help
+ This configures how gcc will emit the synci opcode. Normally, you'd
+ set this to 'M', and configure will do the correct thing (ie. disable).
+ If you know better, you can force using synci (say 'Y'), or not using
+ it (say 'N').
+
+config CC_GCC_mips_plt
+ bool
+ prompt "Use copy relocations & PLTs"
+ help
+ This configures gcc to use copy relocations & PLTs. These are
+ extensions to the traditional SVR4-based MIPS ABIs and require
+ support from GNU binutils and the runtime C library.
+ Say 'N' to keep the default and not use them, say 'Y' to use them.
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -267,6 +267,22 @@
*) extra_config+=( "--with-linker-hash-style=${CT_CC_GCC_LNK_HASH_STYLE}" );;
esac
+ case "${CT_CC_GCC_mips_llsc}" in
+ y) extra_config+=( --with-llsc );;
+ m) ;;
+ *) extra_config+=( --without-llsc );;
+ esac
+
+ case "${CT_CC_GCC_mips_synci}" in
+ y) extra_config+=( --with-synci );;
+ m) ;;
+ *) extra_config+=( --without-synci );;
+ esac
+
+ if [ "${CT_CC_GCC_mips_plt}" ]; then
+ extra_config+=( --with-mips-plt )
+ fi
+
CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'"
# Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
@@ -545,6 +561,22 @@
*) extra_config+=( "--with-linker-hash-style=${CT_CC_GCC_LNK_HASH_STYLE}" );;
esac
+ case "${CT_CC_GCC_mips_llsc}" in
+ y) extra_config+=( --with-llsc );;
+ m) ;;
+ *) extra_config+=( --without-llsc );;
+ esac
+
+ case "${CT_CC_GCC_mips_synci}" in
+ y) extra_config+=( --with-synci );;
+ m) ;;
+ *) extra_config+=( --without-synci );;
+ esac
+
+ if [ "${CT_CC_GCC_mips_plt}" ]; then
+ extra_config+=( --with-mips-plt )
+ fi
+
if [ "${CT_CC_GCC_ENABLE_PLUGINS}" = "y" ]; then
extra_config+=( --enable-plugin )
fi
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-27 21:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 21:40 [PATCH 0 of 4] No static link on Darwin + new gcc options Yann E. MORIN
2011-06-27 21:40 ` [PATCH 1 of 4] configure: disable static linking on Darwin Yann E. MORIN
2011-06-27 21:40 ` [PATCH 2 of 4] cc/gcc: add build-id option Yann E. MORIN
2011-06-27 21:40 ` [PATCH 3 of 4] cc/gcc: add option for linker hash style Yann E. MORIN
2011-06-27 21:48 ` [PATCH 4 of 4] cc/gcc: add MIPS spercific configure options Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).