Ticket #121 (assigned defect)

Opened 2 years ago

Last modified 2 years ago

rpmbuild: should --target really set %_target?

Reported by: jengelh Assigned to: pmatilai (accepted)
Priority: major Milestone:
Component: rpm Version: RPM Development
Keywords: Cc:

Description

--target is used to specify the architecture for which a package should be generated; incidentally it also sets $RPM_OPT_FLAGS which often has things like -mcpu=i686, for example. However, --target sets %_target, which actually looks wrong. By the autotools definitions, "host" is actually the parameter for selecting the arch of the program, while "target" refers to the code produced by that program in turn. Needless to say that "target" is therefore only in use for compilers and alike, standard programs like strace only have host (where it is supposed to run on) and build (where the compiler runs).

Thus, given an rpmbuild strace.spec --target=sparcv9 would still be %configured with --build=sparc64-unknown-linux --host=sparc64-unknown-linux, which is not what was wanted.

Under these considerations, I think rpmbuild's --target should set %_host instead. (Or a --host option needs to be added, whichever is more reasonable.) What do you think?

Change History

01/10/10 09:45:35 changed by pmatilai

  • owner changed from RpmTickets to pmatilai.
  • status changed from new to assigned.

Yup, rpm's idea of --target cross-building is pretty thoroughly foobared wrt modern autotools (maybe they used to have something in common back in -97, I dunno). Part of this has been addressed already: http://rpm.org/gitweb?p=rpm.git;a=commit;h=de218d7069294c615dd45cf274dd109ebbdce335

Sorting it all out is obviously going to need more than that, possibly new cli switches while maintaining some sort of backwards compatibility for current --target.