Message ID | 907f751a-3916-64c9-f650-df182fb3cdce@redhat.com |
---|---|
State | New |
Headers | show |
On 16/08/17 09:09, Florian Weimer wrote: > [ 2374s] gcc: error: -pg and -fomit-frame-pointer are incompatible > > This looks like a GCC deficiency. Anyway, please try the attached patch. for the record: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69690
On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > tst-gmon: Build with -fno-omit-frame-pointer > > If glibc is built with -fomit-frame-pointer to undo the effect of > configuring GCC with --enable-frame-pointer, using -pg by itself results > in a build failure: This works, but what does this have to do with --enable-frame-pointer? Andreas.
On 08/16/2017 05:05 PM, Andreas Schwab wrote: > On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > >> tst-gmon: Build with -fno-omit-frame-pointer >> >> If glibc is built with -fomit-frame-pointer to undo the effect of >> configuring GCC with --enable-frame-pointer, using -pg by itself results >> in a build failure: > > This works, but what does this have to do with --enable-frame-pointer? If you don't use --enable-frame-pointer for GCC, there's no apparent reason to me to build glibc with --fomit-frame-pointer because it's the default (albeit in a fashion that is compatible with -pg). Thanks, Florian
On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > If you don't use --enable-frame-pointer for GCC, there's no apparent > reason to me to build glibc with --fomit-frame-pointer because it's the > default (albeit in a fashion that is compatible with -pg). That is not true. Andreas.
On 08/16/2017 05:20 PM, Andreas Schwab wrote: > On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > >> If you don't use --enable-frame-pointer for GCC, there's no apparent >> reason to me to build glibc with --fomit-frame-pointer because it's the >> default (albeit in a fashion that is compatible with -pg). > > That is not true. It is currently true—I don't see why anyone would want to build glibc this way. Could you enlighten me? Thanks, Florian
On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > On 08/16/2017 05:20 PM, Andreas Schwab wrote: >> On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: >> >>> If you don't use --enable-frame-pointer for GCC, there's no apparent >>> reason to me to build glibc with --fomit-frame-pointer because it's the >>> default (albeit in a fashion that is compatible with -pg). >> >> That is not true. > > It is currently true—I don't see why anyone would want to build glibc > this way. Could you enlighten me? To omit the frame pointer. Andreas.
On 08/16/2017 05:30 PM, Andreas Schwab wrote: > On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > >> On 08/16/2017 05:20 PM, Andreas Schwab wrote: >>> On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: >>> >>>> If you don't use --enable-frame-pointer for GCC, there's no apparent >>>> reason to me to build glibc with --fomit-frame-pointer because it's the >>>> default (albeit in a fashion that is compatible with -pg). >>> >>> That is not true. >> >> It is currently true—I don't see why anyone would want to build glibc >> this way. Could you enlighten me? > > To omit the frame pointer. But GCC does it by default if you don't build with --enable-frame-pointer, at least on i386, which is the architecture for which you reported the failure. Thanks, Florian
On Wed, Aug 16, 2017 at 8:32 AM, Florian Weimer <fweimer@redhat.com> wrote: > On 08/16/2017 05:30 PM, Andreas Schwab wrote: >> On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: >> >>> On 08/16/2017 05:20 PM, Andreas Schwab wrote: >>>> On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: >>>> >>>>> If you don't use --enable-frame-pointer for GCC, there's no apparent >>>>> reason to me to build glibc with --fomit-frame-pointer because it's the >>>>> default (albeit in a fashion that is compatible with -pg). >>>> >>>> That is not true. >>> >>> It is currently true—I don't see why anyone would want to build glibc >>> this way. Could you enlighten me? >> >> To omit the frame pointer. > > But GCC does it by default if you don't build with > --enable-frame-pointer, at least on i386, which is the architecture for > which you reported the failure. gmon/tst-gmon-gprof also fails with GCC defaulting to PIE.
On 08/16/2017 10:03 PM, H.J. Lu wrote: > On Wed, Aug 16, 2017 at 8:32 AM, Florian Weimer <fweimer@redhat.com> wrote: >> On 08/16/2017 05:30 PM, Andreas Schwab wrote: >>> On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: >>> >>>> On 08/16/2017 05:20 PM, Andreas Schwab wrote: >>>>> On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: >>>>> >>>>>> If you don't use --enable-frame-pointer for GCC, there's no apparent >>>>>> reason to me to build glibc with --fomit-frame-pointer because it's the >>>>>> default (albeit in a fashion that is compatible with -pg). >>>>> >>>>> That is not true. >>>> >>>> It is currently true—I don't see why anyone would want to build glibc >>>> this way. Could you enlighten me? >>> >>> To omit the frame pointer. >> >> But GCC does it by default if you don't build with >> --enable-frame-pointer, at least on i386, which is the architecture for >> which you reported the failure. > > gmon/tst-gmon-gprof also fails with GCC defaulting to PIE. That would be a real failure (due to ASLR). Does linking with -pg ordinarily disable PIE? I suppose we could add -pg to LDFLAGS for this test because as Andreas explained earlier, it won't link in the system profiling libraries. Thanks, Florian
On Aug 16 2017, Florian Weimer <fweimer@redhat.com> wrote: > But GCC does it by default if you don't build with > --enable-frame-pointer, No, it doesn't. This has no effect in general. Andreas.
On 08/16/2017 10:09 AM, Florian Weimer wrote: > tst-gmon: Build with -fno-omit-frame-pointer > > If glibc is built with -fomit-frame-pointer to undo the effect of > configuring GCC with --enable-frame-pointer, using -pg by itself results > in a build failure: > > gcc: error: -pg and -fomit-frame-pointer are incompatible > > 2017-08-16 Florian Weimer<fweimer@redhat.com> > > * gmon/Makefile (CFLAGS-tst-gmon.c): Add -fno-omit-frame-pointer. > > diff --git a/gmon/Makefile b/gmon/Makefile > index 39f11acec2..62d96543ff 100644 > --- a/gmon/Makefile > +++ b/gmon/Makefile > @@ -38,7 +38,7 @@ endif > # The mcount code won't work without a frame pointer. > CFLAGS-mcount.c := -fno-omit-frame-pointer > > -CFLAGS-tst-gmon.c := -pg > +CFLAGS-tst-gmon.c := -fno-omit-frame-pointer -pg > LDFLAGS-tst-gmon := $(no-pie-ldflag) > CRT-tst-gmon := $(csu-objpfx)gcrt1.o > tst-gmon-ENV := GMON_OUT_PREFIX=$(objpfx)tst-gmon.data Is this patch still needed? Thanks, Florian
On Okt 05 2017, Florian Weimer <fweimer@redhat.com> wrote: > On 08/16/2017 10:09 AM, Florian Weimer wrote: >> tst-gmon: Build with -fno-omit-frame-pointer >> >> If glibc is built with -fomit-frame-pointer to undo the effect of >> configuring GCC with --enable-frame-pointer, using -pg by itself results >> in a build failure: >> >> gcc: error: -pg and -fomit-frame-pointer are incompatible >> >> 2017-08-16 Florian Weimer<fweimer@redhat.com> >> >> * gmon/Makefile (CFLAGS-tst-gmon.c): Add -fno-omit-frame-pointer. >> >> diff --git a/gmon/Makefile b/gmon/Makefile >> index 39f11acec2..62d96543ff 100644 >> --- a/gmon/Makefile >> +++ b/gmon/Makefile >> @@ -38,7 +38,7 @@ endif >> # The mcount code won't work without a frame pointer. >> CFLAGS-mcount.c := -fno-omit-frame-pointer >> -CFLAGS-tst-gmon.c := -pg >> +CFLAGS-tst-gmon.c := -fno-omit-frame-pointer -pg >> LDFLAGS-tst-gmon := $(no-pie-ldflag) >> CRT-tst-gmon := $(csu-objpfx)gcrt1.o >> tst-gmon-ENV := GMON_OUT_PREFIX=$(objpfx)tst-gmon.data > > Is this patch still needed? Sure. Andreas.
On 10/05/2017 02:19 PM, Andreas Schwab wrote: > On Okt 05 2017, Florian Weimer <fweimer@redhat.com> wrote: > >> On 08/16/2017 10:09 AM, Florian Weimer wrote: >>> tst-gmon: Build with -fno-omit-frame-pointer >>> >>> If glibc is built with -fomit-frame-pointer to undo the effect of >>> configuring GCC with --enable-frame-pointer, using -pg by itself results >>> in a build failure: >>> >>> gcc: error: -pg and -fomit-frame-pointer are incompatible >>> >>> 2017-08-16 Florian Weimer<fweimer@redhat.com> >>> >>> * gmon/Makefile (CFLAGS-tst-gmon.c): Add -fno-omit-frame-pointer. >>> >>> diff --git a/gmon/Makefile b/gmon/Makefile >>> index 39f11acec2..62d96543ff 100644 >>> --- a/gmon/Makefile >>> +++ b/gmon/Makefile >>> @@ -38,7 +38,7 @@ endif >>> # The mcount code won't work without a frame pointer. >>> CFLAGS-mcount.c := -fno-omit-frame-pointer >>> -CFLAGS-tst-gmon.c := -pg >>> +CFLAGS-tst-gmon.c := -fno-omit-frame-pointer -pg >>> LDFLAGS-tst-gmon := $(no-pie-ldflag) >>> CRT-tst-gmon := $(csu-objpfx)gcrt1.o >>> tst-gmon-ENV := GMON_OUT_PREFIX=$(objpfx)tst-gmon.data >> >> Is this patch still needed? > > Sure. Shall I commit it, then? Thanks, Florian
On Okt 05 2017, Florian Weimer <fweimer@redhat.com> wrote:
> Shall I commit it, then?
Yes, please.
Andreas.
On 10/05/2017 02:31 PM, Andreas Schwab wrote: > On Okt 05 2017, Florian Weimer <fweimer@redhat.com> wrote: > >> Shall I commit it, then? > > Yes, please. Done. Thanks, Florian
tst-gmon: Build with -fno-omit-frame-pointer If glibc is built with -fomit-frame-pointer to undo the effect of configuring GCC with --enable-frame-pointer, using -pg by itself results in a build failure: gcc: error: -pg and -fomit-frame-pointer are incompatible 2017-08-16 Florian Weimer <fweimer@redhat.com> * gmon/Makefile (CFLAGS-tst-gmon.c): Add -fno-omit-frame-pointer. diff --git a/gmon/Makefile b/gmon/Makefile index 39f11acec2..62d96543ff 100644 --- a/gmon/Makefile +++ b/gmon/Makefile @@ -38,7 +38,7 @@ endif # The mcount code won't work without a frame pointer. CFLAGS-mcount.c := -fno-omit-frame-pointer -CFLAGS-tst-gmon.c := -pg +CFLAGS-tst-gmon.c := -fno-omit-frame-pointer -pg LDFLAGS-tst-gmon := $(no-pie-ldflag) CRT-tst-gmon := $(csu-objpfx)gcrt1.o tst-gmon-ENV := GMON_OUT_PREFIX=$(objpfx)tst-gmon.data
On 08/16/2017 09:43 AM, Andreas Schwab wrote: > https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:glibc/glibc-testsuite/f/i586 One has to download the whole log file to find this: [ 2374s] gcc: error: -pg and -fomit-frame-pointer are incompatible This looks like a GCC deficiency. Anyway, please try the attached patch. Thanks, Florian