diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2002-05-11 20:48:04 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2002-05-11 20:48:04 +0000 |
commit | 558ab81ed169c70460dcd502050f76b3d47fb9b0 (patch) | |
tree | 729ddeae7608108bb1c3952bc6f52fbcd25bea53 | |
parent | 7124f04eb8cb8dd5cd109cc7d403d661cd63c622 (diff) | |
download | newlib-558ab81ed169c70460dcd502050f76b3d47fb9b0.zip newlib-558ab81ed169c70460dcd502050f76b3d47fb9b0.tar.gz newlib-558ab81ed169c70460dcd502050f76b3d47fb9b0.tar.bz2 |
* libnosys/acconfig.h (HAVE_SECTION_ATTRIBUTES): New macro.
* libnosys/configure.in: Check gcc's support for section attributes.
* libnosys/warning.h: Have link_warning expand to nothing if gcc
does not support section attributes.
-rw-r--r-- | libgloss/ChangeLog | 7 | ||||
-rw-r--r-- | libgloss/libnosys/acconfig.h | 3 | ||||
-rw-r--r-- | libgloss/libnosys/config.h.in | 3 | ||||
-rwxr-xr-x | libgloss/libnosys/configure | 56 | ||||
-rw-r--r-- | libgloss/libnosys/configure.in | 29 | ||||
-rw-r--r-- | libgloss/libnosys/warning.h | 6 |
6 files changed, 76 insertions, 28 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 1e813ae..9134e83 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,10 @@ +2002-05-11 Thomas Fitzsimmons <fitzsim@redhat.com> + + * libnosys/acconfig.h (HAVE_SECTION_ATTRIBUTES): New macro. + * libnosys/configure.in: Check gcc's support for section attributes. + * libnosys/warning.h: Have link_warning expand to nothing if gcc + does not support section attributes. + 2002-04-22 Jonathan Larmour <jlarmour@redhat.com> * arm/syscall.h: New file. To define extra syscall values for RedBoot. diff --git a/libgloss/libnosys/acconfig.h b/libgloss/libnosys/acconfig.h index a9508c7..c6df5d5 100644 --- a/libgloss/libnosys/acconfig.h +++ b/libgloss/libnosys/acconfig.h @@ -19,5 +19,8 @@ /* .pushsection/.popsection directives allowed */ #undef HAVE_ASM_POPSECTION_DIRECTIVE +/* support for section attributes */ +#undef HAVE_SECTION_ATTRIBUTES + /* symbol prefix */ #undef __SYMBOL_PREFIX diff --git a/libgloss/libnosys/config.h.in b/libgloss/libnosys/config.h.in index fa5d9d9..f7fe3fef 100644 --- a/libgloss/libnosys/config.h.in +++ b/libgloss/libnosys/config.h.in @@ -15,5 +15,8 @@ /* .pushsection/.popsection directives allowed */ #undef HAVE_ASM_POPSECTION_DIRECTIVE +/* support for section attributes */ +#undef HAVE_SECTION_ATTRIBUTES + /* symbol prefix */ #undef __SYMBOL_PREFIX diff --git a/libgloss/libnosys/configure b/libgloss/libnosys/configure index 76ee44e..9f18172 100755 --- a/libgloss/libnosys/configure +++ b/libgloss/libnosys/configure @@ -831,43 +831,63 @@ EOF #define HAVE_ASM_PREVIOUS_DIRECTIVE 1 EOF - else - rm -f conftest* + fi + rm -f conftest* fi echo "$ac_t""$libc_cv_asm_previous_directive" 1>&6 - echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6 -echo "configure:841: checking for .popsection assembler directive" >&5 + + echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6 +echo "configure:842: checking for .popsection assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.s <<EOF + cat > conftest.s <<EOF .pushsection foo_section .popsection EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then - cat >> confdefs.h <<\EOF + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + cat >> confdefs.h <<\EOF #define HAVE_ASM_POPSECTION_DIRECTIVE 1 EOF - fi fi rm -f conftest* fi echo "$ac_t""$libc_cv_asm_popsection_directive" 1>&6 - ;; + + echo $ac_n "checking for section attributes""... $ac_c" 1>&6 +echo "configure:862: checking for section attributes" >&5 +if eval "test \"`echo '$''{'libc_cv_section_attributes'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10; +int main() {} +EOF + if { ac_try='${CC-cc} -c $CFLAGS conftest.c 1>&5'; { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + cat >> confdefs.h <<\EOF +#define HAVE_SECTION_ATTRIBUTES 1 +EOF + + fi + rm -f conftest* +fi + +echo "$ac_t""$libc_cv_section_attributes" 1>&6 + ;; esac echo $ac_n "checking for function prefix""... $ac_c" 1>&6 -echo "configure:864: checking for function prefix" >&5 +echo "configure:884: checking for function prefix" >&5 if eval "test \"`echo '$''{'libc_dollar_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<\EOF foo () { } EOF -if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null'; { (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; +if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null'; { (eval echo configure:891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_dollar_prefix=yes else @@ -892,7 +912,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:896: checking for $ac_word" >&5 +echo "configure:916: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -922,7 +942,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:926: checking for $ac_word" >&5 +echo "configure:946: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -971,7 +991,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:975: checking whether we are using GNU C" >&5 +echo "configure:995: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -980,7 +1000,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -995,7 +1015,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:999: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1019: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1031,7 +1051,7 @@ LD=${LD-ld} # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1035: checking for $ac_word" >&5 +echo "configure:1055: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1232,7 +1252,7 @@ cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. diff --git a/libgloss/libnosys/configure.in b/libgloss/libnosys/configure.in index a93133b..9149e39 100644 --- a/libgloss/libnosys/configure.in +++ b/libgloss/libnosys/configure.in @@ -136,27 +136,38 @@ case "${target}" in AC_DEFINE(HAVE_ELF) AC_CACHE_CHECK(for .previous assembler directive, - libc_cv_asm_previous_directive, [dnl + libc_cv_asm_previous_directive, [dnl cat > conftest.s <<EOF .section foo_section .previous EOF if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE) - else - rm -f conftest*]) - AC_CACHE_CHECK(for .popsection assembler directive, + fi + rm -f conftest*]) + + AC_CACHE_CHECK(for .popsection assembler directive, libc_cv_asm_popsection_directive, [dnl - cat > conftest.s <<EOF + cat > conftest.s <<EOF .pushsection foo_section .popsection EOF - if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then - AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE) - fi + if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then + AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE) + fi + rm -f conftest*]) + + AC_CACHE_CHECK(for section attributes, + libc_cv_section_attributes, [dnl + cat > conftest.c <<EOF +int secttest __attribute__ ((section (".gnu.warning.secttest"))) = 10; +int main() {} +EOF + if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.c 1>&AC_FD_CC); then + AC_DEFINE(HAVE_SECTION_ATTRIBUTES) fi rm -f conftest*]) - ;; + ;; esac AC_CACHE_CHECK(for function prefix, libc_dollar_prefix, [dnl diff --git a/libgloss/libnosys/warning.h b/libgloss/libnosys/warning.h index 99f3e0d..2c29982 100644 --- a/libgloss/libnosys/warning.h +++ b/libgloss/libnosys/warning.h @@ -15,10 +15,14 @@ # define __make_section_unallocated(section_string) # endif -# define link_warning(symbol, msg) \ +# ifdef HAVE_SECTION_ATTRIBUTES +# define link_warning(symbol, msg) \ __make_section_unallocated (".gnu.warning." #symbol) \ static const char __evoke_link_warning_##symbol[] \ __attribute__ ((section (".gnu.warning." #symbol))) = msg; +# else +# define link_warning(symbol, msg) +# endif #else /* !ELF */ |