* [Buildroot] [PATCH 1/2] hostapd: fix build @ 2011-07-04 6:00 Baruch Siach 2011-07-04 6:00 ` [Buildroot] [PATCH 2/2] iw: " Baruch Siach 2011-07-04 6:56 ` [Buildroot] [PATCH 1/2] hostapd: " Thomas Petazzoni 0 siblings, 2 replies; 7+ messages in thread From: Baruch Siach @ 2011-07-04 6:00 UTC (permalink / raw) To: buildroot The --sysroot option is required in CFLAGS and LDFLAGS to avoid compile time and link time failures. Signed-off-by: Baruch Siach <baruch@tkos.co.il> --- package/hostapd/hostapd.mk | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk index f097e75..8ca091d 100644 --- a/package/hostapd/hostapd.mk +++ b/package/hostapd/hostapd.mk @@ -71,8 +71,8 @@ endif define HOSTAPD_CONFIGURE_CMDS cp $(@D)/$(HOSTAPD_SUBDIR)/defconfig $(HOSTAPD_CONFIG) $(SED) "s/\/local//" $(@D)/$(HOSTAPD_SUBDIR)/Makefile - echo "CFLAGS += $(TARGET_CFLAGS)" >>$(HOSTAPD_CONFIG) - echo "LDFLAGS += $(TARGET_LDFLAGS)" >>$(HOSTAPD_CONFIG) + echo "CFLAGS += $(TARGET_CFLAGS) --sysroot=$(STAGING_DIR)" >>$(HOSTAPD_CONFIG) + echo "LDFLAGS += $(TARGET_LDFLAGS) --sysroot=$(STAGING_DIR)" >>$(HOSTAPD_CONFIG) echo "CC = $(TARGET_CC)" >>$(HOSTAPD_CONFIG) # Drivers $(SED) "s/^#CONFIG_DRIVER_WIRED/CONFIG_DRIVER_WIRED/" $(HOSTAPD_CONFIG) -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 2/2] iw: fix build 2011-07-04 6:00 [Buildroot] [PATCH 1/2] hostapd: fix build Baruch Siach @ 2011-07-04 6:00 ` Baruch Siach 2011-07-04 6:56 ` [Buildroot] [PATCH 1/2] hostapd: " Thomas Petazzoni 1 sibling, 0 replies; 7+ messages in thread From: Baruch Siach @ 2011-07-04 6:00 UTC (permalink / raw) To: buildroot The --sysroot option is required in CFLAGS and LDFLAGS to avoid compile time and link time failures. Signed-off-by: Baruch Siach <baruch@tkos.co.il> --- package/iw/iw.mk | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/iw/iw.mk b/package/iw/iw.mk index 0f5dd0e..4db47c5 100644 --- a/package/iw/iw.mk +++ b/package/iw/iw.mk @@ -15,8 +15,8 @@ IW_MAKE_ENV = PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \ define IW_CONFIGURE_CMDS echo "CC = $(TARGET_CC)" >$(IW_CONFIG) - echo "CFLAGS = $(TARGET_CFLAGS)" >>$(IW_CONFIG) - echo "LDFLAGS = $(TARGET_LDFLAGS)" >>$(IW_CONFIG) + echo "CFLAGS = $(TARGET_CFLAGS) --sysroot=$(STAGING_DIR)" >>$(IW_CONFIG) + echo "LDFLAGS = $(TARGET_LDFLAGS) --sysroot=$(STAGING_DIR)" >>$(IW_CONFIG) endef define IW_BUILD_CMDS -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] hostapd: fix build 2011-07-04 6:00 [Buildroot] [PATCH 1/2] hostapd: fix build Baruch Siach 2011-07-04 6:00 ` [Buildroot] [PATCH 2/2] iw: " Baruch Siach @ 2011-07-04 6:56 ` Thomas Petazzoni 2011-07-04 7:39 ` Baruch Siach 2011-07-04 14:14 ` Matias Garcia 1 sibling, 2 replies; 7+ messages in thread From: Thomas Petazzoni @ 2011-07-04 6:56 UTC (permalink / raw) To: buildroot Hello, Le Mon, 4 Jul 2011 09:00:29 +0300, Baruch Siach <baruch@tkos.co.il> a ?crit : > The --sysroot option is required in CFLAGS and LDFLAGS to avoid > compile time and link time failures. This should no longer be needed, as Buildroot 2011.05 has added a wrapper for external toolchains which avoids the need to pass an explicit --sysroot option. Can you point to a specific Buildroot configuration that exhibits the problem ? Regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] hostapd: fix build 2011-07-04 6:56 ` [Buildroot] [PATCH 1/2] hostapd: " Thomas Petazzoni @ 2011-07-04 7:39 ` Baruch Siach 2011-07-04 14:14 ` Matias Garcia 1 sibling, 0 replies; 7+ messages in thread From: Baruch Siach @ 2011-07-04 7:39 UTC (permalink / raw) To: buildroot Hi Thomas, On Mon, Jul 04, 2011 at 08:56:28AM +0200, Thomas Petazzoni wrote: > Le Mon, 4 Jul 2011 09:00:29 +0300, > Baruch Siach <baruch@tkos.co.il> a ?crit : > > > The --sysroot option is required in CFLAGS and LDFLAGS to avoid > > compile time and link time failures. > > This should no longer be needed, as Buildroot 2011.05 has added a > wrapper for external toolchains which avoids the need to pass an > explicit --sysroot option. Actually, I've reverted part of this change to solve other problem. In package/Makefile.in I set TARGET_CROSS=$(BR2_TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-. I'm using the CodeSourcery toolchain for a e500v2 target. Without this change I get the following error (from ethtool config.log): configure:3723: /home/baruch/git/buildroot/output/host/usr/bin/powerpc-linux-gnu-cpp conftest.c conftest.c:1:0: error: E500 and FPRs not supported configure:3723: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "ethtool" | #define PACKAGE_TARNAME "ethtool" | #define PACKAGE_VERSION "2.6.38" | #define PACKAGE_STRING "ethtool 2.6.38" | #define PACKAGE_BUGREPORT "Ben Hutchings <bhutchings@solarflare.com>" | #define PACKAGE_URL "" | #define PACKAGE "ethtool" | #define VERSION "2.6.38" | /* end confdefs.h. */ | #ifdef __STDC__ | # include <limits.h> | #else | # include <assert.h> | #endif | Syntax error To solve this I need to pass -te500v2 to cpp. Is there a clean way to do so? I should also note that I add -te500v2 to TARGET_LDFLAGS and TOOLCHAIN_EXTERNAL_CFLAGS in package/Makefile.in and toolchain/toolchain-external/ext-tool.mk, respectively. I can reproduce the errors I get when omitting these changes if it helps. baruch > Can you point to a specific Buildroot configuration that exhibits the > problem ? -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] hostapd: fix build 2011-07-04 6:56 ` [Buildroot] [PATCH 1/2] hostapd: " Thomas Petazzoni 2011-07-04 7:39 ` Baruch Siach @ 2011-07-04 14:14 ` Matias Garcia 2011-07-05 14:08 ` Baruch Siach 1 sibling, 1 reply; 7+ messages in thread From: Matias Garcia @ 2011-07-04 14:14 UTC (permalink / raw) To: buildroot Hi Thomas, On Mon, 2011-07-04 at 08:56 +0200, Thomas Petazzoni wrote: > Hello, > > Le Mon, 4 Jul 2011 09:00:29 +0300, > Baruch Siach <baruch@tkos.co.il> a ?crit : > > > The --sysroot option is required in CFLAGS and LDFLAGS to avoid > > compile time and link time failures. > > This should no longer be needed, as Buildroot 2011.05 has added a > wrapper for external toolchains which avoids the need to pass an > explicit --sysroot option. > > Can you point to a specific Buildroot configuration that exhibits the > problem ? The CodeSourcery PowerPC toolchains require a special flag which selects the sysroot. in our case, the flag is "-e500v2" which takes the place of "-mcpu=8540 -mspe -mabi=spe -mhard-float -mfloat-gprs=double" in a regular BR toolchain. In either case, if these optimizations are not passed to the compiler(s) AND the linker, the code generated can be wrong because (as far as I understand it) the e500 has no generic float instruction support and breaks the generic PowerPC ABI spec. There is currently no way to pass this to the wrapper at compile time. I submitted a couple of patches to allow this, though I'm not sure I did it properly as I simply submitted my diffs. Matias > > Regards, > > Thomas > -- > Thomas Petazzoni, Free Electrons > Kernel, drivers, real-time and embedded Linux > development, consulting, training and support. > http://free-electrons.com > _______________________________________________ > buildroot mailing list > buildroot at busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] hostapd: fix build 2011-07-04 14:14 ` Matias Garcia @ 2011-07-05 14:08 ` Baruch Siach 2011-07-05 14:39 ` Matias Garcia 0 siblings, 1 reply; 7+ messages in thread From: Baruch Siach @ 2011-07-05 14:08 UTC (permalink / raw) To: buildroot Hi Matias, On Mon, Jul 04, 2011 at 10:14:19AM -0400, Matias Garcia wrote: > On Mon, 2011-07-04 at 08:56 +0200, Thomas Petazzoni wrote: > > Hello, > > > > Le Mon, 4 Jul 2011 09:00:29 +0300, > > Baruch Siach <baruch@tkos.co.il> a ?crit : > > > > > The --sysroot option is required in CFLAGS and LDFLAGS to avoid > > > compile time and link time failures. > > > > This should no longer be needed, as Buildroot 2011.05 has added a > > wrapper for external toolchains which avoids the need to pass an > > explicit --sysroot option. > > > > Can you point to a specific Buildroot configuration that exhibits the > > problem ? > > The CodeSourcery PowerPC toolchains require a special flag which selects > the sysroot. in our case, the flag is "-e500v2" which takes the place of > "-mcpu=8540 -mspe -mabi=spe -mhard-float -mfloat-gprs=double" in a > regular BR toolchain. In either case, if these optimizations are not > passed to the compiler(s) AND the linker, the code generated can be > wrong because (as far as I understand it) the e500 has no generic float > instruction support and breaks the generic PowerPC ABI spec. I've noticed that the pre-processor also needs this flag, which is "-te500v2", by the way. > There is currently no way to pass this to the wrapper at compile time. I > submitted a couple of patches to allow this, though I'm not sure I did > it properly as I simply submitted my diffs. For reference, here is the ugly hack that I'm currently using. I'll try to make a proper patch that allows the user to add an arbitrary option to all of CFLAGS/LDFLAGS/CPPFLAGS. baruch commit cbf2807a52408903033e960cd76d9644154980de Author: Baruch Siach <baruch@tkos.co.il> Date: Tue Jul 5 12:06:22 2011 +0300 Crude patch for fixing CodeSourcery e500v2 builds diff --git a/package/Makefile.in b/package/Makefile.in index 31a9639..45c3fce 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -76,6 +76,7 @@ ifeq ($(BR2_LARGEFILE),y) TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 endif +TARGET_LDFLAGS+=-te500v2 TARGET_CXXFLAGS=$(TARGET_CFLAGS) ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y) @@ -173,6 +174,7 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \ DEFAULT_ASSEMBLER="$(TARGET_AS)" \ DEFAULT_LINKER="$(TARGET_LD)" \ CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="-te500v2" \ CXXFLAGS="$(TARGET_CXXFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ FCFLAGS="$(TARGET_FCFLAGS)" \ diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index 9171e85..ffb8e22 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -151,6 +151,8 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1 endif +TOOLCHAIN_EXTERNAL_CFLAGS += -te500v2 + ifeq ($(BR2_VFP_FLOAT),y) TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=vfp TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_VFPFLOAT=1 baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH 1/2] hostapd: fix build 2011-07-05 14:08 ` Baruch Siach @ 2011-07-05 14:39 ` Matias Garcia 0 siblings, 0 replies; 7+ messages in thread From: Matias Garcia @ 2011-07-05 14:39 UTC (permalink / raw) To: buildroot On Tue, 2011-07-05 at 17:08 +0300, Baruch Siach wrote: > Hi Matias, > > On Mon, Jul 04, 2011 at 10:14:19AM -0400, Matias Garcia wrote: > > On Mon, 2011-07-04 at 08:56 +0200, Thomas Petazzoni wrote: > > > Hello, > > > > > > Le Mon, 4 Jul 2011 09:00:29 +0300, > > > Baruch Siach <baruch@tkos.co.il> a ?crit : > > > > > > > The --sysroot option is required in CFLAGS and LDFLAGS to avoid > > > > compile time and link time failures. > > > > > > This should no longer be needed, as Buildroot 2011.05 has added a > > > wrapper for external toolchains which avoids the need to pass an > > > explicit --sysroot option. > > > > > > Can you point to a specific Buildroot configuration that exhibits the > > > problem ? > > > > The CodeSourcery PowerPC toolchains require a special flag which selects > > the sysroot. in our case, the flag is "-e500v2" which takes the place of > > "-mcpu=8540 -mspe -mabi=spe -mhard-float -mfloat-gprs=double" in a > > regular BR toolchain. In either case, if these optimizations are not > > passed to the compiler(s) AND the linker, the code generated can be > > wrong because (as far as I understand it) the e500 has no generic float > > instruction support and breaks the generic PowerPC ABI spec. > > I've noticed that the pre-processor also needs this flag, which is "-te500v2", > by the way. That's interesting. When I use the wrapper, I don't need to supply the flag to anything else, as the wrapper adds it when powerpc-linux-gnu-[cpp|...] is called. Thanks for pointing out my typo. > > There is currently no way to pass this to the wrapper at compile time. I > > submitted a couple of patches to allow this, though I'm not sure I did > > it properly as I simply submitted my diffs. > > For reference, here is the ugly hack that I'm currently using. I'll try to > make a proper patch that allows the user to add an arbitrary option to all of > CFLAGS/LDFLAGS/CPPFLAGS. My patch v1 added a new option to supply a sysroot argument to the wrapper, and v2 simply passed BR2_TARGET_OPTIMIZATIONS instead. You are not actually passing TOOLCHAIN_EXTERNAL_CFLAGS to the wrapper which is why you need to add -te500v2 to your flags. TOOLCHAIN_EXTERNAL_CFLAGS helps buildroot determine which sysroot to use (i.e. which directory to specify in --sysroot), but it doesn't actually pass the flag to the wrapper. If the flag is not found in this array in ext-toolchain-wrapper.c, it is not getting compiled in: static char *predef_args[] = { path, "--sysroot", BR_SYSROOT, #ifdef BR_ARCH "-march=" BR_ARCH, #endif /* BR_ARCH */ #ifdef BR_TUNE "-mtune=" BR_TUNE, #endif /* BR_TUNE */ #ifdef BR_ABI "-mabi=" BR_ABI, #endif #ifdef BR_SOFTFLOAT "-msoft-float", #endif /* BR_SOFTFLOAT */ #ifdef BR_VFPFLOAT "-mfpu=vfp", #endif /* BR_VFPFLOAT */ }; Add the following code after "--sysroot",... and it will work without adding -te500v2 to CFLAGS/CPPFLAGS/LDFLAGS: "-te500v2", Matias > baruch > > commit cbf2807a52408903033e960cd76d9644154980de > Author: Baruch Siach <baruch@tkos.co.il> > Date: Tue Jul 5 12:06:22 2011 +0300 > > Crude patch for fixing CodeSourcery e500v2 builds > > diff --git a/package/Makefile.in b/package/Makefile.in > index 31a9639..45c3fce 100644 > --- a/package/Makefile.in > +++ b/package/Makefile.in > @@ -76,6 +76,7 @@ ifeq ($(BR2_LARGEFILE),y) > TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 > endif > > +TARGET_LDFLAGS+=-te500v2 > TARGET_CXXFLAGS=$(TARGET_CFLAGS) > > ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y) > @@ -173,6 +174,7 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \ > DEFAULT_ASSEMBLER="$(TARGET_AS)" \ > DEFAULT_LINKER="$(TARGET_LD)" \ > CFLAGS="$(TARGET_CFLAGS)" \ > + CPPFLAGS="-te500v2" \ > CXXFLAGS="$(TARGET_CXXFLAGS)" \ > LDFLAGS="$(TARGET_LDFLAGS)" \ > FCFLAGS="$(TARGET_FCFLAGS)" \ > diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk > index 9171e85..ffb8e22 100644 > --- a/toolchain/toolchain-external/ext-tool.mk > +++ b/toolchain/toolchain-external/ext-tool.mk > @@ -151,6 +151,8 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float > TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1 > endif > > +TOOLCHAIN_EXTERNAL_CFLAGS += -te500v2 > + > ifeq ($(BR2_VFP_FLOAT),y) > TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=vfp > TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_VFPFLOAT=1 > > baruch > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110705/4a629cfc/attachment-0001.html> ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-07-05 14:39 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-07-04 6:00 [Buildroot] [PATCH 1/2] hostapd: fix build Baruch Siach 2011-07-04 6:00 ` [Buildroot] [PATCH 2/2] iw: " Baruch Siach 2011-07-04 6:56 ` [Buildroot] [PATCH 1/2] hostapd: " Thomas Petazzoni 2011-07-04 7:39 ` Baruch Siach 2011-07-04 14:14 ` Matias Garcia 2011-07-05 14:08 ` Baruch Siach 2011-07-05 14:39 ` Matias Garcia
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.