All of lore.kernel.org
 help / color / mirror / Atom feed
* ntpclient compile fail
@ 2011-09-27  3:18 Ni Qingliang
  2011-09-27  3:50 ` Ni Qingliang
  2011-09-27 15:46 ` McClintock Matthew-B29882
  0 siblings, 2 replies; 8+ messages in thread
From: Ni Qingliang @ 2011-09-27  3:18 UTC (permalink / raw)
  To: yocto@yoctoproject.org

Hello:
I'm adding ntpclient into my distro.

but build fail, reason is the CFLAGS/LDFLAGS in it's Makefile didn't
take effect.

What can I do?

the original makefile is:
CFLAGS += -fno-strict-aliasing
CFLAGS += -std=c89
CFLAGS += -W -Wall
CFLAGS += -O2
CFLAGS += -DENABLE_DEBUG
CFLAGS += -DENABLE_REPLAY

LDFLAGS += -lrt

all: ntpclient

test: ntpclient
	./ntpclient -d -r <test.dat

ntpclient: ntpclient.o phaselock.o

ntpclient.o phaselock.o: ntpclient.h

adjtimex: adjtimex.o

clean:
	rm -f ntpclient adjtimex *.o

-- 
Yi Qingliang
niqingliang@insigma.com.cn
http://niqingliang2003.wordpress.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-27  3:18 ntpclient compile fail Ni Qingliang
@ 2011-09-27  3:50 ` Ni Qingliang
  2011-09-27 15:46 ` McClintock Matthew-B29882
  1 sibling, 0 replies; 8+ messages in thread
From: Ni Qingliang @ 2011-09-27  3:50 UTC (permalink / raw)
  To: yocto@yoctoproject.org

I have added "override" in the head of every CFLAGS/LDFLAGS line, but
error still there.

the link order is a common problem.
-Wl,-lrt ntpclient.o phaselock.o -o ntpclient
should be
ntpclient.o phaselock.o -Wl,-lrt ntpclient

Does poky have some option or some solution for that?
(I build it success on host.)

On Tue, 2011-09-27 at 11:18 +0800, Ni Qingliang wrote:
> Hello:
> I'm adding ntpclient into my distro.
> 
> but build fail, reason is the CFLAGS/LDFLAGS in it's Makefile didn't
> take effect.
> 
> What can I do?
> 
> the original makefile is:
> CFLAGS += -fno-strict-aliasing
> CFLAGS += -std=c89
> CFLAGS += -W -Wall
> CFLAGS += -O2
> CFLAGS += -DENABLE_DEBUG
> CFLAGS += -DENABLE_REPLAY
> 
> LDFLAGS += -lrt
> 
> all: ntpclient
> 
> test: ntpclient
>         ./ntpclient -d -r <test.dat
> 
> ntpclient: ntpclient.o phaselock.o
> 
> ntpclient.o phaselock.o: ntpclient.h
> 
> adjtimex: adjtimex.o
> 
> clean:
>         rm -f ntpclient adjtimex *.o
> 
> --
> Yi Qingliang
> niqingliang@insigma.com.cn
> http://niqingliang2003.wordpress.com
> 
> 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

-- 
Yi Qingliang
niqingliang@insigma.com.cn
http://niqingliang2003.wordpress.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-27  3:18 ntpclient compile fail Ni Qingliang
  2011-09-27  3:50 ` Ni Qingliang
@ 2011-09-27 15:46 ` McClintock Matthew-B29882
  2011-09-28  1:00   ` Ni Qingliang
  1 sibling, 1 reply; 8+ messages in thread
From: McClintock Matthew-B29882 @ 2011-09-27 15:46 UTC (permalink / raw)
  To: niqingliang@insigma.com.cn; +Cc: yocto@yoctoproject.org

On Mon, Sep 26, 2011 at 10:18 PM, Ni Qingliang
<niqingliang@insigma.com.cn> wrote:
> Hello:
> I'm adding ntpclient into my distro.
>
> but build fail, reason is the CFLAGS/LDFLAGS in it's Makefile didn't
> take effect.

If the CFLAGS are not taking effect from the Makefile are you over
ridding the value in the recipe? Can you point us at a copy of the
recipe you are using?

-M

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-27 15:46 ` McClintock Matthew-B29882
@ 2011-09-28  1:00   ` Ni Qingliang
  2011-09-28  1:50     ` McClintock Matthew-B29882
  0 siblings, 1 reply; 8+ messages in thread
From: Ni Qingliang @ 2011-09-28  1:00 UTC (permalink / raw)
  To: McClintock Matthew-B29882; +Cc: yocto@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

Thanks!

the attachement is the bb file and Makefile(modified),

after 'override' CFLAGS/LDFLAGS in Makefile, I have added
override LDFLAGS += -Wl,--no-as-needed
in the Makefile to neutralize the '-Wl,--as-needed' in the original
LDFLAGS.

and then the world clear.

On Tue, 2011-09-27 at 23:46 +0800, McClintock Matthew-B29882 wrote:
> On Mon, Sep 26, 2011 at 10:18 PM, Ni Qingliang
> <niqingliang@insigma.com.cn> wrote:
> > Hello:
> > I'm adding ntpclient into my distro.
> >
> > but build fail, reason is the CFLAGS/LDFLAGS in it's Makefile didn't
> > take effect.
> 
> If the CFLAGS are not taking effect from the Makefile are you over
> ridding the value in the recipe? Can you point us at a copy of the
> recipe you are using?
> 
> -M

-- 
Yi Qingliang
niqingliang@insigma.com.cn
http://niqingliang2003.wordpress.com


[-- Attachment #2: ntpclient.bb --]
[-- Type: text/plain, Size: 490 bytes --]

DESCRIPTION = "ntpclient"
SECTION = "iotproduct"
LICENSE = "Google"
LIC_FILES_CHKSUM = "file://README;md5=098a6a289094e42f974b11e2151f5644"
PR = "r0"
PV = "2010_365"


SRC_URI = "http://doolittle.icarus.com/ntpclient/ntpclient_${PV}.tar.gz \
           file://Makefile"

S = "${WORKDIR}/${PN}-2010"

do_patch () {
	cp -f ${WORKDIR}/Makefile ${S}/
}

do_compile () {
	oe_runmake
}

do_install () {
	install -d ${D}/bin/
	install -m 0755 ${S}/ntpclient ${D}/bin/
}


[-- Attachment #3: Makefile --]
[-- Type: text/x-makefile, Size: 1053 bytes --]

# A long time ago, far, far away, under Solaris, you needed to
#    CFLAGS += -xO2 -Xc
#    LDLIBS += -lnsl -lsocket
# To cross-compile
#    CC = arm-linux-gcc
# To check for lint
#    CFLAGS += -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wundef \
#     -Waggregate-return -Wnested-externs -Winline -Wwrite-strings -Wstrict-prototypes

# This is old-school networking code, making the traditional cast between
# struct sockaddr* and struct sockaddr_in*.  Thus a modern gcc needs:
override CFLAGS += -fno-strict-aliasing

override CFLAGS += -std=c89
override CFLAGS += -W -Wall
override CFLAGS += -O2
# CFLAGS += -DPRECISION_SIOCGSTAMP
override CFLAGS += -DENABLE_DEBUG
override CFLAGS += -DENABLE_REPLAY
# CFLAGS += -DUSE_OBSOLETE_GETTIMEOFDAY

override LDFLAGS += -Wl,--no-as-needed
override LDFLAGS += -Wl,-lrt

all: ntpclient

test: ntpclient
	./ntpclient -d -r <test.dat

ntpclient: ntpclient.o phaselock.o

ntpclient.o phaselock.o: ntpclient.h

adjtimex: adjtimex.o

clean:
	rm -f ntpclient adjtimex *.o

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-28  1:00   ` Ni Qingliang
@ 2011-09-28  1:50     ` McClintock Matthew-B29882
  2011-09-28  2:04       ` Ni Qingliang
  0 siblings, 1 reply; 8+ messages in thread
From: McClintock Matthew-B29882 @ 2011-09-28  1:50 UTC (permalink / raw)
  To: niqingliang@insigma.com.cn
  Cc: McClintock Matthew-B29882, yocto@yoctoproject.org

On Tue, Sep 27, 2011 at 8:00 PM, Ni Qingliang
<niqingliang@insigma.com.cn> wrote:
> the attachement is the bb file and Makefile(modified),

It usually best to include these attachments inline when possible.

> after 'override' CFLAGS/LDFLAGS in Makefile, I have added
> override LDFLAGS += -Wl,--no-as-needed
> in the Makefile to neutralize the '-Wl,--as-needed' in the original
> LDFLAGS.
>
> and then the world clear.

Are you editing the source files in this package or the recipe itself?

-M

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-28  1:50     ` McClintock Matthew-B29882
@ 2011-09-28  2:04       ` Ni Qingliang
  2011-09-28  2:12         ` McClintock Matthew-B29882
  0 siblings, 1 reply; 8+ messages in thread
From: Ni Qingliang @ 2011-09-28  2:04 UTC (permalink / raw)
  To: McClintock Matthew-B29882; +Cc: yocto@yoctoproject.org

1. sorry, I will.
2. Yes, I made a new Makefile (based on the original) as the patch of
ntpclient (which will override the original Makefile).

On Wed, 2011-09-28 at 09:50 +0800, McClintock Matthew-B29882 wrote:
> On Tue, Sep 27, 2011 at 8:00 PM, Ni Qingliang
> <niqingliang@insigma.com.cn> wrote:
> > the attachement is the bb file and Makefile(modified),
> 
> It usually best to include these attachments inline when possible.
> 
> > after 'override' CFLAGS/LDFLAGS in Makefile, I have added
> > override LDFLAGS += -Wl,--no-as-needed
> > in the Makefile to neutralize the '-Wl,--as-needed' in the original
> > LDFLAGS.
> >
> > and then the world clear.
> 
> Are you editing the source files in this package or the recipe itself?
> 
> -M

-- 
Yi Qingliang
niqingliang@insigma.com.cn
http://niqingliang2003.wordpress.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-28  2:04       ` Ni Qingliang
@ 2011-09-28  2:12         ` McClintock Matthew-B29882
  2011-09-28  2:33           ` Ni Qingliang
  0 siblings, 1 reply; 8+ messages in thread
From: McClintock Matthew-B29882 @ 2011-09-28  2:12 UTC (permalink / raw)
  To: niqingliang@insigma.com.cn
  Cc: McClintock Matthew-B29882, yocto@yoctoproject.org

On Tue, Sep 27, 2011 at 9:04 PM, Ni Qingliang
<niqingliang@insigma.com.cn> wrote:
> 1. sorry, I will.
> 2. Yes, I made a new Makefile (based on the original) as the patch of
> ntpclient (which will override the original Makefile).

There are lots of ways to do this and avoid making a patch. You can
use EXTRA_OECONF, EXTRA_OEMAKE, EXTRA_CFLAGS, etc in the recipe itself
to fix up the build process. You can even go and modify the variables
in the do_configure, do_compile, etc build steps as well.

-M

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ntpclient compile fail
  2011-09-28  2:12         ` McClintock Matthew-B29882
@ 2011-09-28  2:33           ` Ni Qingliang
  0 siblings, 0 replies; 8+ messages in thread
From: Ni Qingliang @ 2011-09-28  2:33 UTC (permalink / raw)
  To: McClintock Matthew-B29882; +Cc: yocto@yoctoproject.org

thanks.

If we want to use the original Makefile, we must get rid of the "-e" and
"-Wl,as-needed" in original arguments, for latter, we can add
"-Wl,--no-as-needed", but what about the "-e"?

On Wed, 2011-09-28 at 10:12 +0800, McClintock Matthew-B29882 wrote:
> On Tue, Sep 27, 2011 at 9:04 PM, Ni Qingliang
> <niqingliang@insigma.com.cn> wrote:
> > 1. sorry, I will.
> > 2. Yes, I made a new Makefile (based on the original) as the patch of
> > ntpclient (which will override the original Makefile).
> 
> There are lots of ways to do this and avoid making a patch. You can
> use EXTRA_OECONF, EXTRA_OEMAKE, EXTRA_CFLAGS, etc in the recipe itself
> to fix up the build process. You can even go and modify the variables
> in the do_configure, do_compile, etc build steps as well.
> 
> -M

-- 
Yi Qingliang
niqingliang@insigma.com.cn
http://niqingliang2003.wordpress.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-28  2:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-27  3:18 ntpclient compile fail Ni Qingliang
2011-09-27  3:50 ` Ni Qingliang
2011-09-27 15:46 ` McClintock Matthew-B29882
2011-09-28  1:00   ` Ni Qingliang
2011-09-28  1:50     ` McClintock Matthew-B29882
2011-09-28  2:04       ` Ni Qingliang
2011-09-28  2:12         ` McClintock Matthew-B29882
2011-09-28  2:33           ` Ni Qingliang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.