Replies: 4 comments
-
It's indeed a weird and confused mess. I think some of it is just an ancient misunderstanding on how the autofoo build/host/target mean to begin with adopted to rpm lingo, but then the semantics within autoconf have changed over time too (see https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html#Hosts-and-Cross_002dCompilation). And along the road, people have tweaked the rpm side semantics to the point that nobody knows what it all means, how it should work and consequently nobody including myself dares to touch it. It'd be a good thing to have this sanitized, if we can find brave enough people to tackle it... |
Beta Was this translation helpful? Give feedback.
-
There's been work downstream in OpenMandriva to make cross-compilation work in RPM, I can take a look and bringing those upstream when I get some spare cycles... |
Beta Was this translation helpful? Give feedback.
-
cc: @berolinux |
Beta Was this translation helpful? Give feedback.
-
Oh and see also #103 |
Beta Was this translation helpful? Give feedback.
-
This issue may be a misunderstanding on my side, so take the following with a grain of salt.
I'm confused by rpm's handling of %_build, %_host, and %_target. In autofoo speech (this is what rpm's definitions are based on), --build is the local host architecture, --host is the architecture we're building for, and --target is the architecture for compiler code generation if we're building a compiler.
Rpm's usage is kind of weird in that regard:
%_target_cpu et al is used for the rpm result architecture (i.e. what --host is specifying)
%_host et al is set to the host rpm was build with (i.e. like --build)
%_build expands to %_host
There's also %_build_arch in the platform file which is thus changing with rpm's --target option.
I'm somewhat confused why %_build expands to %_host. Wouldn't it make more sense to do set %_build to the fixed values and set %_host to
%_build
? That way one could change %_host when doing a cross compile.It's also weird that the --target option does not change %_host, like it ought to do. We can't change the %_target_cpu usages in rpm and spec file, but we could change both %_host and %_target.
I'm surly not the first one experimenting with cross building with rpm, so this is probably not something new. And autofoo's weird usage of --build, --host, --target doesn't help either...
Beta Was this translation helpful? Give feedback.
All reactions