[openib-general] Re: [PATCH] add LDFLAGS to perftest/Makefile
Nishanth Aravamudan
nacc at us.ibm.com
Thu Dec 15 10:03:14 PST 2005
On 15.12.2005 [09:35:12 +0200], Michael S. Tsirkin wrote:
> Quoting r. Nishanth Aravamudan <nacc at us.ibm.com>:
> > Subject: Re: [PATCH] add LDFLAGS to perftest/Makefile
> >
> > On 15.12.2005 [08:57:24 +0200], Michael S. Tsirkin wrote:
> > > Quoting Nishanth Aravamudan <nacc at us.ibm.com>:
> > > > Is there a reason the perftest/Makefile doesn't use LDFLAGS?
> > > > Specifically, in automating userspace build & test, I put the IB
> > > > libraries in a temporary directory, and exporting CFLAGS and LDFLAGS
> > > > works with all other Makefiles (well, the ones I expect to work),
> > but
> > > > perftest does not seem to pick up my exports.
> > > >
> > > > Would something like the following make sense (sorry if a different
> > -p
> > > > is preferred)? Or does it need to be +=?
> > > >
> > > > Description: Add LDFLAGS to the perftest Makefile to allow library
> > > > directories in non-standard locations to be specified.
> > >
> > > Are you using gnu make? which version?
> >
> > GNU Make 3.80 on SLES 9 SP2.
> >
> > > Gnu make should use LDFLAGS automatically:
> > >
> > > Linking a single object file
> > > `N' is made automatically from `N.o' by running the linker
> > > (usually called `ld') via the C compiler. The precise command
> > > used is `$(CC) $(LDFLAGS) N.o $(LOADLIBES) $(LDLIBS)'.
> >
> > I thought this would be the case as well, but it didn't seem to work
> > without the Makefile modification.
> >
> > > > Signed-off-by: Nishanth Aravamudan <nacc at us.ibm.com>
> > > >
> > > > --- Makefile 2005-12-14 14:57:04.000000000 -0800
> > > > +++ Makefile.ldflags 2005-12-14 14:57:23.000000000 -0800
> > > > @@ -2,6 +2,7 @@ TESTS = rdma_lat rdma_bw
> > > >
> > > > all: ${TESTS}
> > > >
> > > > +LDFLAGS +=
> > > > CFLAGS += -Wall -O2 -g -D_GNU_SOURCE
> > > > LOADLIBES += -libverbs
> > > > EXTRA_FILES = get_clock.c
> > >
> > > This really does nothing. Does this patch help you?
> >
> > I didn't think it should do anything either, but it did allow the make
> > to work on both ppc32 and ppc64 with LDFLAGS exported in the
> > environment. Without the change, the build would fail as it would not
> > have the appropriate -L flags.
>
> Looks like a work around for bug in make. I'll have a look.
Would make more sense than it does now if that's the case :)
Thanks,
Nish
More information about the general
mailing list