cmake-build-system sets wrong CMAKE_SYSTEM_NAME when crossbuilding for Hurd

  • Done
  • quality assurance status badge
Details
One participant
  • Dariqq
Owner
unassigned
Submitted by
Dariqq
Severity
normal

Debbugs page

Dariqq wrote 7 months ago
(address . bug-guix@gnu.org)
f7026fdc-078b-450a-a1ae-252811b8aa03@posteo.net
Hi,

I was playing around with a package using cmake and got an error when
crossbuilding for i586-pc-gnu. The reason seems to be that cmake build
system only checks for a mingw target and assumes all other targets are
Linux and sets CMAKE_SYSTEM_NAME accordingly.

I am able to work around it by adding something like

#$@(if (and (%current-target-system)
target-hurd?)
'("-DCMAKE_SYSTEM_NAME=GNU")
'())

to the configure-flags of my package.


I am unsure how a fix should look like. I was thinking of moving the
entire crossbuild code out of the build side and instead prepend the
right configure flags for the target to configure-flags for the cross
builder kind of similar how meson-build-system does it.

Unfortunately a change like this causes a lot of rebuilds.
Dariqq wrote 2 months ago
Closing bugs
(address . 72697-done@debbugs.gnu.org)(address . 68366-done@debbugs.gnu.org)
839573a7-fc11-4622-922d-2d72d224176e@posteo.net
Hello,

I sent https://issues.guix.gnu.org/72751to move the cross compile logic
out of the build side code, also adding GNU as a CMAKE_SYSTEM_NAME with
a fallback of Generic.

Because this no longer lives in build code it should now be easier to
add a new SYSTEM_NAME without recompiling the cmake world.

This is now in master.
ad672d80d7 * build-system: cmake: Rework cross compilation

So I am closing these.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 72697@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72697
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help