From patchwork Tue Dec 7 14:26:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svr4.h avoidance: arc Date: Tue, 07 Dec 2010 04:26:11 -0000 From: "Joseph S. Myers" X-Patchwork-Id: 74547 Message-Id: To: gcc-patches@gcc.gnu.org This patch starts the series of patches removing svr4.h from the headers used by particular targets in GCC. All of these patches are relative to a tree with the first three patches for particular macros applied. This patch stops arc-*-elf* from using svr4.h. The only macro used from that header was LIB_SPEC. The svr4.h definition #undef LIB_SPEC #define LIB_SPEC "%{!shared:%{!symbolic:-lc}}" seems inappropriate for generic ELF targets (in general you do want to link with -lc even when building a shared library) so I used the simpler "-lc" for LIB_SPEC and will do so as applicable for other targets currently inheriting this macro setting from svr4.h. Tested building cc1 and xgcc for a cross to arc-elf. OK to commit? (NB there is no listed maintainer for this target at present.) 2010-12-07 Joseph Myers * config/arc/arc.h (LIB_SPEC): Define. * config.gcc (arc-*-elf*): Don't use svr4.h. diff -rupN --exclude=.svn gcc-mainline-3/gcc/config/arc/arc.h gcc-mainline/gcc/config/arc/arc.h --- gcc-mainline-3/gcc/config/arc/arc.h 2010-12-02 09:39:19.000000000 -0800 +++ gcc-mainline/gcc/config/arc/arc.h 2010-12-07 06:20:01.000000000 -0800 @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. #undef ASM_SPEC #undef LINK_SPEC +#undef LIB_SPEC #undef STARTFILE_SPEC #undef ENDFILE_SPEC #undef SIZE_TYPE @@ -66,6 +67,8 @@ along with GCC; see the file COPYING3. #define LINK_SPEC "%{v} %{EB} %{EL}" +#define LIB_SPEC "-lc" + #define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s" #define ENDFILE_SPEC "crtfini.o%s" diff -rupN --exclude=.svn gcc-mainline-3/gcc/config.gcc gcc-mainline/gcc/config.gcc --- gcc-mainline-3/gcc/config.gcc 2010-12-06 03:31:49.000000000 -0800 +++ gcc-mainline/gcc/config.gcc 2010-12-07 06:09:45.000000000 -0800 @@ -761,7 +761,7 @@ alpha*-dec-*vms*) extra_options="${extra_options} vms/vms.opt" ;; arc-*-elf*) - tm_file="dbxelf.h elfos.h svr4.h newlib-stdint.h ${tm_file}" + tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}" extra_parts="crtinit.o crtfini.o" ;; arm-wrs-vxworks)