GNU bug report logs -
#48044
[PATCH] build/go: Support cross compiling.
Previous Next
Reported by: Efraim Flashner <efraim <at> flashner.co.il>
Date: Mon, 26 Apr 2021 18:34:02 UTC
Severity: normal
Tags: patch
Done: Efraim Flashner <efraim <at> flashner.co.il>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
> + ;; We really only support targeting Linux and mingw.
> + (setenv "GOOS" (if (string-contains target "mingw")
> + "windows"
> + "linux"))
If only Linux and mingw is supported, perhaps some kind of error
could be thrown if 'target' does not contain either "mingw" or "linux",
to avoid silently compiling for the wrong operating system? There is
the Hurd as well for example.
I would recommend throwing the error (or returning #f?) from lower,
to notify the user cross-compilation is not possible as early as possible.
> + (setenv "GOARM" "7") ; Default is 6, target our armhf-linux architecture.
Would it be possible to only set that variable when targetting armhf-linux?
Setting this when targetting other architectures seems unlikely to cause issues,
but still seems subtly wrong to me, for some value of subtle.
Note: I do not know much about go and did not test this.
Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 249 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.