From d4f78700878b587f344b29040ba6b5b53fd57598 Mon Sep 17 00:00:00 2001 From: cvs2svn <> Date: Wed, 29 Mar 2006 22:38:47 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'newlib-autotools- branch'. Sprout from newlib-csl-20060320-branch 2006-03-21 00:57:35 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'newlib-' Cherrypick from master 2006-03-29 22:38:46 UTC Jeff Johnston '': compile libgloss/ChangeLog libgloss/mt/startup-16-002.S libgloss/mt/startup-16-003.S libgloss/mt/startup-ms2.S newlib/ChangeLog newlib/configure newlib/configure.host newlib/configure.in newlib/libc/stdio/freopen.c newlib/libc/stdio64/freopen64.c newlib/libc/sys/linux/include/net/if.h newlib/libc/sys/linux/include/netinet/ip.h newlib/libc/sys/linux/io.c newlib/libc/sys/linux/net/name6.c newlib/libc/sys/linux/sys/ioccom.h newlib/libtool.m4 --- compile | 142 +++++++++++++++++++++++++++++ libgloss/ChangeLog | 6 ++ libgloss/mt/startup-16-002.S | 2 +- libgloss/mt/startup-16-003.S | 2 +- libgloss/mt/startup-ms2.S | 2 +- newlib/ChangeLog | 47 ++++++++++ newlib/configure | 2 +- newlib/configure.host | 8 ++ newlib/configure.in | 2 +- newlib/libc/stdio/freopen.c | 2 +- newlib/libc/stdio64/freopen64.c | 2 +- newlib/libc/sys/linux/include/net/if.h | 7 +- newlib/libc/sys/linux/include/netinet/ip.h | 2 + newlib/libc/sys/linux/io.c | 4 +- newlib/libc/sys/linux/net/name6.c | 8 +- newlib/libc/sys/linux/sys/ioccom.h | 2 +- newlib/libtool.m4 | 2 +- 17 files changed, 225 insertions(+), 17 deletions(-) create mode 100755 compile diff --git a/compile b/compile new file mode 100755 index 000000000..1b1d23216 --- /dev/null +++ b/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index 7457e3dbf..095dec1cc 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,9 @@ +2006-03-22 Nathan Sidwell + + * mt/startup-16-002.S (.internal_io): Make @nobits. + * mt/startup-16-003.S (.internal_io): Make @nobits. + * mt/startup-ms2.S (.internal_io): Make @nobits. + 2006-03-02 DJ Delorie * m32c/exit.S: Preserve r1. diff --git a/libgloss/mt/startup-16-002.S b/libgloss/mt/startup-16-002.S index 475a120bd..d1732d6ed 100644 --- a/libgloss/mt/startup-16-002.S +++ b/libgloss/mt/startup-16-002.S @@ -180,7 +180,7 @@ _IVEC_DEFAULT: or r0, r0, r0 - .section .internal_io, "a", @progbits + .section .internal_io, "a", @nobits .fill 256 ; Fill the first page. ; This is the memory-mapped I/O region. diff --git a/libgloss/mt/startup-16-003.S b/libgloss/mt/startup-16-003.S index 9f65f5d4d..9fe23b95a 100644 --- a/libgloss/mt/startup-16-003.S +++ b/libgloss/mt/startup-16-003.S @@ -185,7 +185,7 @@ _IVEC_DEFAULT: or r0, r0, r0 - .section .internal_io, "a", @progbits + .section .internal_io, "a", @nobits .fill 256 ; Fill the first page. ; This is the memory-mapped I/O region. diff --git a/libgloss/mt/startup-ms2.S b/libgloss/mt/startup-ms2.S index f11e3fa6a..846c72c12 100644 --- a/libgloss/mt/startup-ms2.S +++ b/libgloss/mt/startup-ms2.S @@ -187,7 +187,7 @@ _IVEC_DEFAULT: or r0, r0, r0 - .section .internal_io, "a", @progbits + .section .internal_io, "a", @nobits .fill 256 ; Fill the first page. ; This is the memory-mapped I/O region. diff --git a/newlib/ChangeLog b/newlib/ChangeLog index fec04f0b7..506d2cc95 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,50 @@ +2006-03-29 Shaun Jackman + + * libc/sys/linux/include/netinet/ip.h: Include netinet/in_systm.h + for the declaration of n_long. + +2006-03-29 Shaun Jackman + + * libc/sys/linux/include/net/if.h: Include sys/socket.h for + struct sockaddr. + (IFF_SMART): Replace this define with IFF_NOTRAILERS. + (IFF_CANTCHANGE): Replace IFF_SMART reference with IFF_NOTRAILERS. + (IFF_NOTRAILERS): New define. + (struct ifreq): Add ifru_netmask. + (ifr_netmask): New define. + +2006-03-29 Shaun Jackman + + * libc/sys/linux/sys/ioccom.h (ioctl): Change declaration to + match sys/ioctl.h. + +2006-03-29 Shaun Jackman + + * libtool.m4: Set lt_cv_deplibs_check_method=pass_all for + linux-newlib libc implementations. + +2006-03-29 Eric Blake + + * libc/stdio/freopen.c (_freopen_r) [__SCLE]: Fix typo. + * libc/stdio64/freopen64.c (_freopen64_r) [__SCLE]: Likewise. + +2006-03-29 Jeff Johnston + + * libc/sys/linux/io.c (__mknod): Fix declaration of + syscall to pass a dev_t as third argument rather than + a pointer to dev_t. + +2006-03-29 Jeff Johnston + + * libc/sys/linux/net/name6.c: Fix struct references. + +2006-03-22 Mark Mitchell + + * configure.host: Allow hosts to set the default + newlib_atexit_dynamic_alloc value. + * configure.in: Likewise. + * configure: Regenerated. + 2006-03-20 Mark Mitchell * acconfig.h (_ATEXIT_DYNAMIC_ALLOC): Undef. diff --git a/newlib/configure b/newlib/configure index ce9246a31..e3004c3ef 100755 --- a/newlib/configure +++ b/newlib/configure @@ -705,7 +705,7 @@ if test "${enable_newlib_atexit_dynamic_alloc+set}" = set; then esac fi else - newlib_atexit_dynamic_alloc=yes + newlib_atexit_dynamic_alloc=${newlib_atexit_dynamic_alloc} fi am__api_version="1.4" diff --git a/newlib/configure.host b/newlib/configure.host index d85e8ad2c..759c38adb 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -63,6 +63,7 @@ have_sys_mach_dir=no default_newlib_io_long_long=no default_newlib_io_long_double=no default_newlib_io_pos_args=no +default_newlib_atexit_dynamic_alloc=yes aext=a oext=o @@ -738,6 +739,13 @@ if [ "x${newlib_io_pos_args}" = "x" ]; then fi fi +# Disable atexit dynamic allocation if requested. +if [ "x${newlib_atexit_dynamic_alloc}" = "x" ]; then + if [ ${default_newlib_atexit_dynamic_alloc} = "yes" ]; then + newlib_atexit_dynamic_alloc="yes"; + fi +fi + if test -z "${have_crt0}" && test -n "${sys_dir}"; then have_crt0="yes" fi diff --git a/newlib/configure.in b/newlib/configure.in index c8dc21176..3cd213c6f 100644 --- a/newlib/configure.in +++ b/newlib/configure.in @@ -94,7 +94,7 @@ AC_ARG_ENABLE(newlib-atexit-dynamic-alloc, no) newlib_atexit_dynamic_alloc=no ;; *) AC_MSG_ERROR(bad value ${enableval} for newlib-atexit-dynamic-alloc option) ;; esac - fi], [newlib_atexit_dynamic_alloc=yes])dnl + fi], [newlib_atexit_dynamic_alloc=${newlib_atexit_dynamic_alloc}])dnl NEWLIB_CONFIGURE(.) diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index ae3444b1b..f1fc9dad8 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -168,7 +168,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), * F_SETFL doesn't change textmode. Don't mess with modes of ttys. */ if (0 <= f && ! isatty (f) - && setmode (f, flags & (O_BINARY | O_TEXT)) == -1) + && setmode (f, oflags & (O_BINARY | O_TEXT)) == -1) f = -1; #endif diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c index 6081e03dc..cb766051c 100644 --- a/newlib/libc/stdio64/freopen64.c +++ b/newlib/libc/stdio64/freopen64.c @@ -168,7 +168,7 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), * F_SETFL doesn't change textmode. Don't mess with modes of ttys. */ if (0 <= f && ! isatty (f) - && setmode (f, flags & (O_BINARY | O_TEXT)) == -1) + && setmode (f, oflags & (O_BINARY | O_TEXT)) == -1) f = -1; #endif diff --git a/newlib/libc/sys/linux/include/net/if.h b/newlib/libc/sys/linux/include/net/if.h index bf021e6f9..5671b11f4 100644 --- a/newlib/libc/sys/linux/include/net/if.h +++ b/newlib/libc/sys/linux/include/net/if.h @@ -38,6 +38,7 @@ #define _NET_IF_H_ #include +#include /* * does not depend on on most other systems. This @@ -122,7 +123,7 @@ struct if_data { #define IFF_DEBUG 0x4 /* turn on debugging */ #define IFF_LOOPBACK 0x8 /* is a loopback net */ #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ -#define IFF_SMART 0x20 /* interface manages own routes */ +#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ #define IFF_RUNNING 0x40 /* resources allocated */ #define IFF_NOARP 0x80 /* no address resolution protocol */ #define IFF_PROMISC 0x100 /* receive all packets */ @@ -147,7 +148,7 @@ struct if_data { /* flags set internally only: */ #define IFF_CANTCHANGE \ (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\ - IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART) + IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_NOTRAILERS) /* Capabilities that interfaces can advertise. */ #define IFCAP_RXCSUM 0x0001 /* can offload checksum on RX */ @@ -227,6 +228,7 @@ struct ifreq { struct sockaddr ifru_addr; struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; short ifru_flags[2]; short ifru_index; int ifru_metric; @@ -239,6 +241,7 @@ struct ifreq { #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ #define ifr_flags ifr_ifru.ifru_flags[0] /* flags */ #define ifr_prevflags ifr_ifru.ifru_flags[1] /* flags */ #define ifr_metric ifr_ifru.ifru_metric /* metric */ diff --git a/newlib/libc/sys/linux/include/netinet/ip.h b/newlib/libc/sys/linux/include/netinet/ip.h index 0e6df1eea..2b2bcb831 100644 --- a/newlib/libc/sys/linux/include/netinet/ip.h +++ b/newlib/libc/sys/linux/include/netinet/ip.h @@ -37,6 +37,8 @@ #ifndef _NETINET_IP_H_ #define _NETINET_IP_H_ +#include + /* * Definitions for internet protocol version 4. * Per RFC 791, September 1981. diff --git a/newlib/libc/sys/linux/io.c b/newlib/libc/sys/linux/io.c index d6731144a..25dccc660 100644 --- a/newlib/libc/sys/linux/io.c +++ b/newlib/libc/sys/linux/io.c @@ -65,12 +65,12 @@ int flock(int fd,int operation) #if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 3 -static _syscall3(int,__mknod,const char *,path,mode_t,mode,dev_t *,dev) +static _syscall3(int,__mknod,const char *,path,mode_t,mode,dev_t,dev) int mkfifo(const char *path, mode_t mode) { dev_t dev = 0; - return __mknod(path, mode | S_IFIFO, &dev); + return __mknod(path, mode | S_IFIFO, dev); } #endif diff --git a/newlib/libc/sys/linux/net/name6.c b/newlib/libc/sys/linux/net/name6.c index 80037e8f9..f220e213c 100644 --- a/newlib/libc/sys/linux/net/name6.c +++ b/newlib/libc/sys/linux/net/name6.c @@ -1499,16 +1499,16 @@ _dns_ghbyname(void *rval, void *cb_data, va_list ap) #ifdef INET6 switch (af) { case AF_UNSPEC: - &rtl4->rtl_entry = NULL; rtl4.rtl_type = T_A; - &rtl6->rtl_entry = &rtl4; rtl6.rtl_type = T_AAAA; + rtl4.rtl_entry = NULL; rtl4.rtl_type = T_A; + rtl6.rtl_entry = &rtl4; rtl6.rtl_type = T_AAAA; rtl = &rtl6; break; case AF_INET6: - &rtl6->rtl_entry = NULL; rtl6.rtl_type = T_AAAA; + rtl6.rtl_entry = NULL; rtl6.rtl_type = T_AAAA; rtl = &rtl6; break; case AF_INET: - &rtl4->rtl_entry = NULL; rtl4.rtl_type = T_A; + rtl4.rtl_entry = NULL; rtl4.rtl_type = T_A; rtl = &rtl4; break; } diff --git a/newlib/libc/sys/linux/sys/ioccom.h b/newlib/libc/sys/linux/sys/ioccom.h index 4a063e973..e656d5ef6 100644 --- a/newlib/libc/sys/linux/sys/ioccom.h +++ b/newlib/libc/sys/linux/sys/ioccom.h @@ -67,7 +67,7 @@ #include __BEGIN_DECLS -int ioctl(int, unsigned long, ...); +int ioctl(int __fd, int __request, ...); __END_DECLS #endif diff --git a/newlib/libtool.m4 b/newlib/libtool.m4 index 3f452bcba..ff5fb4753 100644 --- a/newlib/libtool.m4 +++ b/newlib/libtool.m4 @@ -620,7 +620,7 @@ irix5* | irix6*) ;; # This must be Linux ELF. -linux-gnu*) +linux-gnu*|linux-newlib*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; -- cgit v1.2.3