| Submitter | Darren Hart |
|---|---|
| Date | March 20, 2012, 6:39 p.m. |
| Message ID | <4F68CEDA.2060101@linux.intel.com> |
| Download | mbox | patch |
| Permalink | /patch/23919/ |
| State | New |
| Headers | show |
Comments
On Tue, Mar 20, 2012 at 11:39:22AM -0700, Darren Hart wrote: > On 03/20/2012 09:09 AM, Denys Dmytriyenko wrote: > > On Tue, Mar 20, 2012 at 08:33:14AM -0700, Darren Hart wrote: > >> > >> > >> On 03/20/2012 08:28 AM, Denys Dmytriyenko wrote: > >>> On Tue, Mar 20, 2012 at 08:01:44AM -0700, Darren Hart wrote: > >>>> > >>>> > >>>> On 03/19/2012 05:22 PM, Denys Dmytriyenko wrote: > >>>>> From: Denys Dmytriyenko <denys@ti.com> > >>>>> > >>>>> Replace dependency on eglibc with virtual/libc > >>>>> Pass LDFLAGS to TARGET_CC_ARCH, instead of CFLAGS as Makefile overrides it > >>>>> > >>>>> Signed-off-by: Denys Dmytriyenko <denys@ti.com> > >>>> > >>>> Thanks Denys, > >>>> > >>>> Looking through the rt-tests sources I don't see TARGET_CC_ARCH > >>>> anywhere. Have you confirmed that changes made there make their way into > >>>> the actual build? > >>> > >>> Darren, > >>> > >>> TARGET_CC_ARCH is not an rt-tests specific variable, it's used in OE. > >>> Although, TARGET_LDFLAGS might be more appropriate for this purpose, > >>> historically TARGET_CC_ARCH was heavily used to pass distro LDFLAGS to the > >>> app's build process - grepping it would show many such cases in OE-Core and > >>> especially in meta-oe... > >> > >> OK, thanks for the context. Will you be resubmitting with TARGET_LDFLAGS? > > > > Nope, my bad, it's actually the other way around. From bitbake.conf: > > > > export LDFLAGS = "${TARGET_LDFLAGS}" > > > > So, appending to TARGET_CC_ARCH is the simplest way to pass flags, as that's > > embedded into $CC > > > > Another option would have been to call make with -e flag to let environment > > variables override the ones in the Makefile, but that's less controlled... > > > > How about the follow patch against rt-tests? Clark W. said he's fine taking a > patch that allows such an override. Does this meet your needs? It does look good. Especially if it gets upstreamed! :) If those default CFLAGS should always be there, then you can do something like: CFLAGS ?= CFLAGS += -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include But that would mean there's no way to override those from outside, only add to them... Thanks for taking time to upstream the fix. I'll need to re-submit my patch to only do the eglibc -> virtual/libc change.
On 03/20/2012 11:59 AM, Denys Dmytriyenko wrote: > On Tue, Mar 20, 2012 at 11:39:22AM -0700, Darren Hart wrote: >> On 03/20/2012 09:09 AM, Denys Dmytriyenko wrote: >>> On Tue, Mar 20, 2012 at 08:33:14AM -0700, Darren Hart wrote: >>>> >>>> >>>> On 03/20/2012 08:28 AM, Denys Dmytriyenko wrote: >>>>> On Tue, Mar 20, 2012 at 08:01:44AM -0700, Darren Hart wrote: >>>>>> >>>>>> >>>>>> On 03/19/2012 05:22 PM, Denys Dmytriyenko wrote: >>>>>>> From: Denys Dmytriyenko <denys@ti.com> >>>>>>> >>>>>>> Replace dependency on eglibc with virtual/libc >>>>>>> Pass LDFLAGS to TARGET_CC_ARCH, instead of CFLAGS as Makefile overrides it >>>>>>> >>>>>>> Signed-off-by: Denys Dmytriyenko <denys@ti.com> >>>>>> >>>>>> Thanks Denys, >>>>>> >>>>>> Looking through the rt-tests sources I don't see TARGET_CC_ARCH >>>>>> anywhere. Have you confirmed that changes made there make their way into >>>>>> the actual build? >>>>> >>>>> Darren, >>>>> >>>>> TARGET_CC_ARCH is not an rt-tests specific variable, it's used in OE. >>>>> Although, TARGET_LDFLAGS might be more appropriate for this purpose, >>>>> historically TARGET_CC_ARCH was heavily used to pass distro LDFLAGS to the >>>>> app's build process - grepping it would show many such cases in OE-Core and >>>>> especially in meta-oe... >>>> >>>> OK, thanks for the context. Will you be resubmitting with TARGET_LDFLAGS? >>> >>> Nope, my bad, it's actually the other way around. From bitbake.conf: >>> >>> export LDFLAGS = "${TARGET_LDFLAGS}" >>> >>> So, appending to TARGET_CC_ARCH is the simplest way to pass flags, as that's >>> embedded into $CC >>> >>> Another option would have been to call make with -e flag to let environment >>> variables override the ones in the Makefile, but that's less controlled... >>> >> >> How about the follow patch against rt-tests? Clark W. said he's fine taking a >> patch that allows such an override. Does this meet your needs? > > It does look good. Especially if it gets upstreamed! :) > > If those default CFLAGS should always be there, then you can do something > like: > > CFLAGS ?= > CFLAGS += -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include > > But that would mean there's no way to override those from outside, only add to > them... > > Thanks for taking time to upstream the fix. I'll need to re-submit my patch to > only do the eglibc -> virtual/libc change. > Great, I'll submit to rt-users now then. We should be able to pull the patch into oe-core as well.
Patch
diff --git a/Makefile b/Makefile index 4038dcc..e1edf6c 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ ifneq ($(filter x86_64 i386 ia64 mips powerpc,$(machinetype)),) NUMA := 1 endif -CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include +CFLAGS ?= -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include +LDFLAGS ?= PYLIB := $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()') @@ -61,41 +62,41 @@ all: $(TARGETS) hwlatdetect -include $(sources:.c=.d) cyclictest: cyclictest.o rt-utils.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(NUMA_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(NUMA_LIBS) signaltest: signaltest.o rt-utils.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) pi_stress: pi_stress.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) hwlatdetect: src/hwlatdetect/hwlatdetect.py chmod +x src/hwlatdetect/hwlatdetect.py ln -s src/hwlatdetect/hwlatdetect.py hwlatdetect rt-migrate-test: rt-migrate-test.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) ptsematest: ptsematest.o rt-utils.o rt-get_cpu.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) sigwaittest: sigwaittest.o rt-utils.o rt-get_cpu.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) svsematest: svsematest.o rt-utils.o rt-get_cpu.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) pmqtest: pmqtest.o rt-utils.o rt-get_cpu.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) sendme: sendme.o rt-utils.o rt-get_cpu.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXTRA_LIBS) pip_stress: pip_stress.o error.o rt-utils.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) hackbench: hackbench.o - $(CC) $(CFLAGS) -o $@ $^ $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) CLEANUP = $(TARGETS) *.o .depend *.*~ *.orig *.rej rt-tests.spec *.d CLEANUP += $(if $(wildcard .git), ChangeLog)