From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 02:05:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8506DE1; Fri, 21 Nov 2014 02:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1A14FB1; Fri, 21 Nov 2014 02:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAL25sQ4050997; Fri, 21 Nov 2014 02:05:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAL25nGB050901; Fri, 21 Nov 2014 02:05:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201411210205.sAL25nGB050901@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Nov 2014 02:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274772 - in head: lib/libc/gen lib/libc/include lib/libc/sys lib/libkiconv lib/libmd lib/libthr/thread lib/msun/src libexec/rtld-elf sys/amd64/include sys/arm/include sys/i386/include ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 02:05:55 -0000 Author: emaste Date: Fri Nov 21 02:05:48 2014 New Revision: 274772 URL: https://svnweb.freebsd.org/changeset/base/274772 Log: Use canonical __PIC__ flag It is automatically set when -fPIC is passed to the compiler. Reviewed by: dim, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1179 Modified: head/lib/libc/gen/errlst.c head/lib/libc/gen/isnan.c head/lib/libc/gen/tls.c head/lib/libc/include/errlst.h head/lib/libc/sys/stack_protector.c head/lib/libc/sys/stack_protector_compat.c head/lib/libkiconv/quirks.c head/lib/libkiconv/xlat16_iconv.c head/lib/libkiconv/xlat16_sysctl.c head/lib/libmd/rmd160c.c head/lib/libmd/sha1c.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_private.h head/lib/msun/src/s_isnan.c head/libexec/rtld-elf/rtld.c head/sys/amd64/include/asm.h head/sys/arm/include/asm.h head/sys/i386/include/asm.h head/sys/powerpc/include/asm.h head/sys/powerpc/include/profile.h head/sys/sparc64/include/asm.h Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/gen/errlst.c Fri Nov 21 02:05:48 2014 (r274772) @@ -158,7 +158,7 @@ const char *const sys_errlist[] = { }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); -#ifdef PIC +#ifdef __PIC__ __strong_reference(sys_errlist, __hidden_sys_errlist); __strong_reference(sys_nerr, __hidden_sys_nerr); #endif Modified: head/lib/libc/gen/isnan.c ============================================================================== --- head/lib/libc/gen/isnan.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/gen/isnan.c Fri Nov 21 02:05:48 2014 (r274772) @@ -40,7 +40,7 @@ * time, when calling both functions. */ -#ifdef PIC +#ifdef __PIC__ __weak_reference(__isnan, isnan); __weak_reference(__isnanf, isnanf); @@ -61,4 +61,4 @@ __isnanf(float f) u.f = f; return (u.bits.exp == 255 && u.bits.man != 0); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/gen/tls.c Fri Nov 21 02:05:48 2014 (r274772) @@ -78,7 +78,7 @@ void __libc_free_tls(void *tls, size_t t #define TLS_VARIANT_II #endif -#ifndef PIC +#ifndef __PIC__ #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) @@ -107,7 +107,7 @@ __libc_tls_get_addr(void *ti __unused) return (0); } -#ifndef PIC +#ifndef __PIC__ #ifdef TLS_VARIANT_I @@ -264,14 +264,14 @@ __libc_free_tls(void *tcb __unused, size { } -#endif /* PIC */ +#endif /* __PIC__ */ extern char **environ; void _init_tls() { -#ifndef PIC +#ifndef __PIC__ Elf_Addr *sp; Elf_Auxinfo *aux, *auxp; Elf_Phdr *phdr; Modified: head/lib/libc/include/errlst.h ============================================================================== --- head/lib/libc/include/errlst.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/include/errlst.h Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ #include -#ifdef PIC +#ifdef __PIC__ /* If the main executable imports these, do not use its copy from libc.so. */ extern const char *const __hidden_sys_errlist[] __hidden; extern const int __hidden_sys_nerr __hidden; Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/sys/stack_protector.c Fri Nov 21 02:05:48 2014 (r274772) @@ -115,6 +115,6 @@ __chk_fail(void) __fail("buffer overflow detected; terminated"); } -#ifndef PIC +#ifndef __PIC__ __weak_reference(__stack_chk_fail, __stack_chk_fail_local); #endif Modified: head/lib/libc/sys/stack_protector_compat.c ============================================================================== --- head/lib/libc/sys/stack_protector_compat.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libc/sys/stack_protector_compat.c Fri Nov 21 02:05:48 2014 (r274772) @@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$"); void __stack_chk_fail(void); -#ifdef PIC +#ifdef __PIC__ void __stack_chk_fail_local_hidden(void) { Modified: head/lib/libkiconv/quirks.c ============================================================================== --- head/lib/libkiconv/quirks.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libkiconv/quirks.c Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ * when statically linked. */ -#ifdef PIC +#ifdef __PIC__ /* * Why do we need quirks? @@ -193,4 +193,4 @@ kiconv_quirkcs(const char* base __unused return (base); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libkiconv/xlat16_iconv.c ============================================================================== --- head/lib/libkiconv/xlat16_iconv.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libkiconv/xlat16_iconv.c Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ * when statically linked. */ -#ifdef PIC +#ifdef __PIC__ #include #include @@ -462,4 +462,4 @@ kiconv_add_xlat16_cspairs(const char *to return (-1); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libkiconv/xlat16_sysctl.c ============================================================================== --- head/lib/libkiconv/xlat16_sysctl.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libkiconv/xlat16_sysctl.c Fri Nov 21 02:05:48 2014 (r274772) @@ -37,7 +37,7 @@ * when statically linked. */ -#ifdef PIC +#ifdef __PIC__ #include #include @@ -82,4 +82,4 @@ kiconv_add_xlat16_table(const char *to _ return (EINVAL); } -#endif /* PIC */ +#endif /* __PIC__ */ Modified: head/lib/libmd/rmd160c.c ============================================================================== --- head/lib/libmd/rmd160c.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libmd/rmd160c.c Fri Nov 21 02:05:48 2014 (r274772) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); * The assembly-language code is not position-independent, so don't * try to use it in a shared library. */ -#ifdef PIC +#ifdef __PIC__ #undef RMD160_ASM #endif Modified: head/lib/libmd/sha1c.c ============================================================================== --- head/lib/libmd/sha1c.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libmd/sha1c.c Fri Nov 21 02:05:48 2014 (r274772) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); * The assembly-language code is not position-independent, so don't * try to use it in a shared library. */ -#ifdef PIC +#ifdef __PIC__ #undef SHA1_ASM #endif Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libthr/thread/thr_exit.c Fri Nov 21 02:05:48 2014 (r274772) @@ -54,7 +54,7 @@ __weak_reference(_pthread_exit, pthread_ static int message_printed; static void thread_unwind(void) __dead2; -#ifdef PIC +#ifdef __PIC__ static void thread_uw_init(void); static _Unwind_Reason_Code thread_unwind_stop(int version, _Unwind_Action actions, @@ -114,7 +114,7 @@ _Unwind_GetCFA(struct _Unwind_Context *c #else #pragma weak _Unwind_GetCFA #pragma weak _Unwind_ForcedUnwind -#endif /* PIC */ +#endif /* __PIC__ */ static void thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception *e) @@ -222,11 +222,11 @@ _pthread_exit_mask(void *status, sigset_ curthread->ret = status; #ifdef _PTHREAD_FORCED_UNWIND -#ifdef PIC +#ifdef __PIC__ thread_uw_init(); -#endif /* PIC */ +#endif /* __PIC__ */ -#ifdef PIC +#ifdef __PIC__ if (uwl_forcedunwind != NULL) { #else if (_Unwind_ForcedUnwind != NULL) { Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/libthr/thread/thr_private.h Fri Nov 21 02:05:48 2014 (r274772) @@ -100,7 +100,7 @@ TAILQ_HEAD(mutex_queue, pthread_mutex); #define THR_ASSERT(cond, msg) #endif -#ifdef PIC +#ifdef __PIC__ # define STATIC_LIB_REQUIRE(name) #else # define STATIC_LIB_REQUIRE(name) __asm (".globl " #name) Modified: head/lib/msun/src/s_isnan.c ============================================================================== --- head/lib/msun/src/s_isnan.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/lib/msun/src/s_isnan.c Fri Nov 21 02:05:48 2014 (r274772) @@ -31,7 +31,7 @@ #include "fpmath.h" /* Provided by libc.so */ -#ifndef PIC +#ifndef __PIC__ #undef isnan int isnan(double d) @@ -41,7 +41,7 @@ isnan(double d) u.d = d; return (u.bits.exp == 2047 && (u.bits.manl != 0 || u.bits.manh != 0)); } -#endif /* !PIC */ +#endif /* !__PIC__ */ int __isnanf(float f) Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Nov 21 01:53:40 2014 (r274771) +++ head/libexec/rtld-elf/rtld.c Fri Nov 21 02:05:48 2014 (r274772) @@ -1817,7 +1817,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * objtmp.path = NULL; objtmp.rtld = true; objtmp.mapbase = mapbase; -#ifdef PIC +#ifdef __PIC__ objtmp.relocbase = mapbase; #endif if (RTLD_IS_DYNAMIC()) { Modified: head/sys/amd64/include/asm.h ============================================================================== --- head/sys/amd64/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/amd64/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -38,7 +38,7 @@ #include -#ifdef PIC +#ifdef __PIC__ #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOTPCREL(%rip) #else Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/arm/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -104,7 +104,7 @@ #define ASMSTR .asciz -#if defined(PIC) +#if defined(__PIC__) #define PLT_SYM(x) PIC_SYM(x, PLT) #define GOT_SYM(x) PIC_SYM(x, GOT) #define GOT_GET(x,got,sym) \ @@ -131,7 +131,7 @@ #define GOT_INIT(got,gotsym,pclabel) #define GOT_INITSYM(gotsym,pclabel) #define PIC_SYM(x,y) x -#endif /* PIC */ +#endif /* __PIC__ */ #undef __FBSDID #if !defined(lint) && !defined(STRIP_FBSDID) Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/i386/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -38,7 +38,7 @@ #include -#ifdef PIC +#ifdef __PIC__ #define PIC_PROLOGUE \ pushl %ebx; \ call 1f; \ Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/powerpc/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -37,7 +37,7 @@ #include -#if defined(PIC) && !defined(__powerpc64__) +#if defined(__PIC__) && !defined(__powerpc64__) #define PIC_PROLOGUE XXX #define PIC_EPILOGUE XXX #define PIC_PLT(x) x@plt Modified: head/sys/powerpc/include/profile.h ============================================================================== --- head/sys/powerpc/include/profile.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/powerpc/include/profile.h Fri Nov 21 02:05:48 2014 (r274772) @@ -119,7 +119,7 @@ __asm( " .text \n" \ " blr \n"); #else -#ifdef PIC +#ifdef __PIC__ #define _PLT "@plt" #else #define _PLT Modified: head/sys/sparc64/include/asm.h ============================================================================== --- head/sys/sparc64/include/asm.h Fri Nov 21 01:53:40 2014 (r274771) +++ head/sys/sparc64/include/asm.h Fri Nov 21 02:05:48 2014 (r274772) @@ -41,7 +41,7 @@ #include -#ifdef PIC +#ifdef __PIC__ #define PIC_PROLOGUE(r1, r2) \ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), r1 ; \ rd %pc, r2 ; \