After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732359 - task-build: allow setting architecture-specific cflags for a module
task-build: allow setting architecture-specific cflags for a module
Status: RESOLVED OBSOLETE
Product: gnome-continuous
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Continuous maintainer(s)
GNOME Continuous maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-06-27 19:29 UTC by Owen Taylor
Modified: 2021-06-05 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
task-build: allow setting architecture-specific cflags for a module (1.91 KB, patch)
2014-06-27 19:29 UTC, Owen Taylor
reviewed Details | Review

Description Owen Taylor 2014-06-27 19:29:21 UTC
In some cases, a module might need specific CFLAGS for an architecture
(an example of this is that iPXE is always 32-bit, so passing
in our generic x86_64 bit cflags breaks it.)
Comment 1 Owen Taylor 2014-06-27 19:29:23 UTC
Created attachment 279438 [details] [review]
task-build: allow setting architecture-specific cflags for a module
Comment 2 Colin Walters 2014-06-27 22:23:57 UTC
Review of attachment 279438 [details] [review]:

What about supporting explicit architecture overrides, like "architecture": "i686" in the manifest?
Comment 3 Owen Taylor 2014-06-29 22:26:13 UTC
So, I dug into this a bit more, and didn't really figure out anything satisfactory. It's actually grub that has the problem, not iPXE (iPXE just ignores CFLAGS set in the environment), and with grub, the situation is pretty confused:

Grub builds in three environments - the build environment (build utils), host environment (grub utils), and the target environment (the bootloader). The documentation claims that CFLAGS is just host-specific cflags and TARGET_CFLAGS and BUILD_CFLAGS are separate, but as far as I can tell, this doesn't reflect reality - CFLAGS is pretty much always passed in when compiling, and there is a separate HOST_CFLAGS.

Overriding the architecture and using the 32-bit cflags isn't going to work because we need the utilities to be built for 64-bit - we don't include a 32-bit C library in the x86_64 build.

Possible fixes:

 * Have some option: 'no_cflags: true' that means don't pass CFLAGS and CXXFLAGS. Basically, we just need to assume that grub will respect setarch and do something reasonable - trying to micromanage it's cflags is a ton of work.

 * This patch - it behaves the same as the first option because grub actually overrides the standard default CFLAGS to '' instead of the normal '-g O2'. It's hackier than the first option in this application, but more flexible

 * Heavily patch (submit upstream) changes to grub's build system to try and make CFLAGS work as documented - I don't see this as appealing - it looks like it would require a ton of fighting automake.

 * Lightly patch in a non-upstream fashion grub's build system just enough to make it ignore CFLAGS passed in the environment - like:

  # We don't want -g -O2 by default in CFLAGS
 -: ${CFLAGS=""}
 +CFLAGS=""

I'll vote for this patch, but could be convinced to do any of the above other than a major rework of grub's CFLAGS handleing.
Comment 4 Colin Walters 2014-06-30 01:24:05 UTC
Hmmm.  Is this grub actually used in a real target system?  Are you adding the BLS patch?

With this rationale your patch is OK by me.
Comment 6 Owen Taylor 2014-06-30 14:51:38 UTC
(In reply to comment #4)
> Hmmm.  Is this grub actually used in a real target system?  Are you adding the
> BLS patch?

grub is used when booting a target system to test it. The operation I want is:

 Find a boot partition by label
 Boot the boot loader configuration stored on that partition

syslinux can't do this for multiple reasons. (Can't read a kernel from a different partition than where syslinux is installed, etc.)

Grub however can. I had some problems with the BLS patch - if I recall correctly it didn't handle selecting the right OS configuration to boot correctly - so instead I'm using the syslinux support in recent versions of grub to read the syslinux configuration that ostree writes.
Comment 7 André Klapper 2021-06-05 16:29:25 UTC
gnome-continuous is not under active development anymore. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-continuous

Closing all its open tickets as part of housekeeping.