* [Buildroot] xorg-server not using target cflags
@ 2010-11-27 0:42 Matt Johnson
2010-11-27 21:25 ` Peter Korsgaard
0 siblings, 1 reply; 5+ messages in thread
From: Matt Johnson @ 2010-11-27 0:42 UTC (permalink / raw)
To: buildroot
Hello,
I'm relatively new to buildroot, but I've had some recent success with most of the system. However, I have been having problems getting X to run on my target platform, which is a custom s3c2410 board. Trying to run Xfbdev always caused an Illegal Instruction error.
I'm using a CodeSourcery external toolchain, and it requires -march=armv4t to be supplied, or it builds with armv5t instructions by default. This hasn't been a problem for most packages, but I found that for the xserver_xorg-server package, none of the CFLAGS were being set properly.
I found that the /package/x11r7/xserver_xorg-server/xserver_xorg-server.mk file has overridden the CFLAGS to include the pixman-1 library. In doing so, it appear that the regular CFLAGS are no longer passed along. I was able to fix this by including $(TARGET_CFLAGS) as well. This seems like the best way to resolve the problem properly.
I no longer get the Illegal Instruction error, and it appears to launch X properly now.
Assuming this fix is ok, please apply the following patch to buildroot to close this bug.
Thanks,
Matt
*** package/x11r7/xserver_xorg-server/xserver_xorg-server.mk 1969-12-31 17:00:00.000000000 -0700
--- package/x11r7/xserver_xorg-server/xserver_xorg-server.mk 2010-11-26 14:57:23.000000000 -0700
***************
*** 60,66 ****
XSERVER_XORG_SERVER_CONF_OPT = --disable-config-hal \
--disable-xnest --disable-xephyr --disable-xvfb \
--with-builder-addr=buildroot at uclibc.org \
! CFLAGS="-I$(STAGING_DIR)/usr/include/pixman-1" \
--with-fontdir=/usr/share/fonts/X11/
ifeq ($(BR2_PACKAGE_XSERVER_xorg),y)
--- 60,66 ----
XSERVER_XORG_SERVER_CONF_OPT = --disable-config-hal \
--disable-xnest --disable-xephyr --disable-xvfb \
--with-builder-addr=buildroot at uclibc.org \
! CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/pixman-1" \
--with-fontdir=/usr/share/fonts/X11/
ifeq ($(BR2_PACKAGE_XSERVER_xorg),y)
^ permalink raw reply [flat|nested] 5+ messages in thread* [Buildroot] xorg-server not using target cflags
2010-11-27 0:42 [Buildroot] xorg-server not using target cflags Matt Johnson
@ 2010-11-27 21:25 ` Peter Korsgaard
2010-11-28 1:00 ` Matt Johnson
0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2010-11-27 21:25 UTC (permalink / raw)
To: buildroot
>>>>> "Matt" == Matt Johnson <mj1856@hotmail.com> writes:
Matt> Hello,
Matt> I'm relatively new to buildroot, but I've had some recent success
Matt> with most of the system. However, I have been having problems
Matt> getting X to run on my target platform, which is a custom s3c2410
Matt> board. Trying to run Xfbdev always caused an Illegal Instruction
Matt> error.
Matt> I'm using a CodeSourcery external toolchain, and it requires
Matt> -march=armv4t to be supplied, or it builds with armv5t
Matt> instructions by default. This hasn't been a problem for most
Matt> packages, but I found that for the xserver_xorg-server package,
Matt> none of the CFLAGS were being set properly.
Matt> I found that the
Matt> /package/x11r7/xserver_xorg-server/xserver_xorg-server.mk file
Matt> has overridden the CFLAGS to include the pixman-1 library. In
Matt> doing so, it appear that the regular CFLAGS are no longer passed
Matt> along. I was able to fix this by including $(TARGET_CFLAGS) as
Matt> well. This seems like the best way to resolve the problem
Matt> properly.
Matt> I no longer get the Illegal Instruction error, and it appears to launch X properly now.
Matt> Assuming this fix is ok, please apply the following patch to buildroot to close this bug.
Thanks, committed. Could you in the future use unified diffs (diff -u),
please? - Or even better use git and 'git format-patch'.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] xorg-server not using target cflags
2010-11-27 21:25 ` Peter Korsgaard
@ 2010-11-28 1:00 ` Matt Johnson
2010-11-28 10:11 ` Peter Korsgaard
0 siblings, 1 reply; 5+ messages in thread
From: Matt Johnson @ 2010-11-28 1:00 UTC (permalink / raw)
To: buildroot
>
> Thanks, committed. Could you in the future use unified diffs (diff -u),
> please? - Or even better use git and 'git format-patch'.
>
Will do. Like I said, I'm new here. :)
BTW - I'm having similar Illegal Instruction problems with fontconfig and freetype. I will post back when I have solutions for those. I'm all ears if you have suggestions - as I don't see the same CFLAGS issue as the main xserver package.
Thanks,
-Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] xorg-server not using target cflags
2010-11-28 1:00 ` Matt Johnson
@ 2010-11-28 10:11 ` Peter Korsgaard
2010-11-29 3:55 ` [Buildroot] packages " Matt Johnson
0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2010-11-28 10:11 UTC (permalink / raw)
To: buildroot
>>>>> "Matt" == Matt Johnson <mj1856@hotmail.com> writes:
Hi,
>> Thanks, committed. Could you in the future use unified diffs (diff
>> -u), please? - Or even better use git and 'git format-patch'.
>>
Matt> Will do. Like I said, I'm new here. :)
Great.
Matt> BTW - I'm having similar Illegal Instruction problems with
Matt> fontconfig and freetype. I will post back when I have solutions
Matt> for those. I'm all ears if you have suggestions - as I don't see
Matt> the same CFLAGS issue as the main xserver package.
I atleast see a CFLAGS override in the fontconfig package, so that might
be why.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] packages not using target cflags
2010-11-28 10:11 ` Peter Korsgaard
@ 2010-11-29 3:55 ` Matt Johnson
0 siblings, 0 replies; 5+ messages in thread
From: Matt Johnson @ 2010-11-29 3:55 UTC (permalink / raw)
To: buildroot
> Matt> BTW - I'm having similar Illegal Instruction problems with
> Matt> fontconfig and freetype. I will post back when I have solutions
> Matt> for those. I'm all ears if you have suggestions - as I don't see
> Matt> the same CFLAGS issue as the main xserver package.
>
> I atleast see a CFLAGS override in the fontconfig package, so that might
> be why.
Okay, I have workarounds, but I need some help here.
For fontconfig, there is a line at the top of fontconfig.mk with the following comments:
# This package does not like using the target cflags for some reason.
FONTCONFIG_CONF_ENV = CFLAGS="-I$(STAGING_DIR)/usr/include/freetype2"
The statement about it not liking the target cflags appears to be incorrect - at least for me. Simple commenting out (or removing) the lines takes care of the problem and fontconfig builds properly. Perhaps whomever added this had a specific case that failed? At any rate, it doesn't seem right to not pass target cflags.
For freetype, I'm not sure how to get the required changes into freetype.mk. I don't know enough about how freetype's makefiles were designed. But on line 90 of output/build/freetype-2.3.12/builds/unix/unix-cc.mk, there is a definition for CCraw as follows:
CCraw := $(CC)
Changing this to:
CCraw := $(CC) $(CFLAGS)
takes care of the problem. I'm uncomfortable with this though, because of the "raw" in the variable name, I'm thinking there was some purpose to not include the cflags to begin with, but I have no idea what that would be. Further down the same file on line 108 is where the usage of CCraw is, and this is the compilation that causes the illegal instruction in my case because of the missing -march=armvt from my CFLAGS.
To get this change in to the freetype.mk file, wouldn't you have to inlclude the CFLAGS into the actual CC variable? Is there a simple way to do this with buildroot's existing syntax? Or should I approach the freetype community about changing their makefile?
Thanks,
Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-29 3:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-27 0:42 [Buildroot] xorg-server not using target cflags Matt Johnson
2010-11-27 21:25 ` Peter Korsgaard
2010-11-28 1:00 ` Matt Johnson
2010-11-28 10:11 ` Peter Korsgaard
2010-11-29 3:55 ` [Buildroot] packages " Matt Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox