Message ID | 87bn75ybeb.fsf@kepler.schwinge.homeip.net |
---|---|
State | New |
Headers | show |
Thomas Schwinge, on Wed 24 Feb 2016 23:46:36 +0100, wrote: > I guess getting -D_REENTRANT for -pthread won't do us any harm? It won't. > > --- gcc/config/i386/gnu.h.orig 2015-09-17 21:41:13.000000000 +0000 > > +++ gcc/config/i386/gnu.h 2015-09-17 23:03:57.000000000 +0000 > > @@ -27,11 +27,11 @@ > > #undef STARTFILE_SPEC > > #if defined HAVE_LD_PIE > > #define STARTFILE_SPEC \ > > - "%{!shared: %{pg|p|profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ > > + "%{!shared: %{pg|p:gcrt1.o%s;profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ > > crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" > > #else > > #define STARTFILE_SPEC \ > > - "%{!shared: %{pg|p|profile:gcrt0.o%s;static:crt0.o%s;:crt1.o%s}} \ > > + "%{!shared: %{pg|p:gcrt1.o%s;profile:gcrt0.o%s;static:crt0.o%s;:crt1.o%s}} \ > > crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" > > #endif > > I think I understand what you're trying to do (avoid gcrt0.o being used > for -pg or -p, and instead use gcrt1.o), Yes. > Likewise, for -pg or -p, I would assume that we > still need gcrt0.o for static linking, and gcrt1.o for dynamic linking. Mmm, probably indeed. > - "%{!shared: %{pg|p|profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ > + "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ Yes, that looks reasonable. Samuel
Samuel Thibault, on Thu 25 Feb 2016 00:18:21 +0100, wrote: > Thomas Schwinge, on Wed 24 Feb 2016 23:46:36 +0100, wrote: > > I guess getting -D_REENTRANT for -pthread won't do us any harm? > > It won't. (Actually we've been using this in Debian for a long time). Samuel
--- gcc/config/gnu.h +++ gcc/config/gnu.h @@ -19,14 +19,6 @@ You should have received a copy of the GNU General Public License along with GCC. If not, see <http://www.gnu.org/licenses/>. */ -/* Provide GCC options for standard feature-test macros. */ -#undef CPP_SPEC -#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" - -/* Default C library spec. */ -#undef LIB_SPEC -#define LIB_SPEC "%{pthread:-lpthread} %{pg|p|profile:-lc_p;:-lc}" - #undef GNU_USER_TARGET_OS_CPP_BUILTINS #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ do { \ --- gcc/config/i386/gnu.h +++ gcc/config/i386/gnu.h @@ -27,11 +27,11 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>. #undef STARTFILE_SPEC #if defined HAVE_LD_PIE #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ + "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" #else #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:gcrt0.o%s;static:crt0.o%s;:crt1.o%s}} \ + "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" #endif