Clarify %_build*, %_host* and %_target* macros #2889
Unanswered
Vogtinator
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Nobody knows. See #1650 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I stumbled across an issue in relation to the %_host* and %_target* macros which subtly broke some builds because of armv7l/armv7hl differences. This led me to dig into this a bit further and at this point I'm now unsure how those macros are actually meant to be used.
macros.in says:
The
@host*@
placeholders are set to whatever CMake runs on (e.g.CMAKE_HOST_SYSTEM_PROCESSOR
), i.e. on what platform RPM was built on. I think this is already wrong. In the (currently unlikely) case that RPM was cross compiled, e.g. on an x86_64 machine to run on riscv64, @host_cpu@ and thus%_host_cpu
would be x86_64. What machine RPM was built on should not have any effect on RPM though.And then I'm confused about the role of build/host/target here. From my understanding, having all three of them implies the toolchain semantics:
build -> where the build happens
host -> where the built binary runs on
target -> what the built binary (e.g. compiler) targets
Question remains from which PoV this is. From RPM's PoV or the .spec file's PoV?
The rpmbuild
--target
option changes which architecture the built RPMs can be installed on and sets%_target*
accordingly. This points to RPM's PoV. The%configure
macro however uses%{_configure} --host=%{_host} --build=%{_build}
, which means it's from the .spec file's PoV. This doesn't match. Example:As you can see, configure was invoked to create a binary to run on
x86_64-suse-linux
but it spat out an RPM for i686:test-0-0.i686.rpm
.Beta Was this translation helpful? Give feedback.
All reactions