Looking at the build logs for F-12, e.g.:
http://kojipkgs.fedoraproject.org/packages/glib2/2.22.4/1.fc12/data/logs/i68...
we seem to have things set up to run configure as:
--build=i386-redhat-linux-gnu --host=i386-redhat-linux-gnu --target=i686-redhat-linux-gnu
Which, according to my reading of the autoconf manual means:
* Build on a i386-redhat-linux-gnu * Create code that runs on i386-redhat-linux-gnu * Build a cross tool chain that targets i686-redhat-linux-gnu
and really doesn't make sense. I'm pretty sure we want to pass i686-redhat-linux-gnu for --host, and we don't need to specify --target.
See http://www.gnu.org/software/autoconf/manual/autoconf.html#System-Type, or the info pages which have different text and are a bit clearer.
In fact, we really could just specify --build, I think and have that go for all three.
Am I missing something here? This is causing GLib to build using slow fallbacks for atomic operations, and likely causes other problems as well.
- Owen
Owen Taylor (otaylor@redhat.com) said:
Looking at the build logs for F-12, e.g.:
http://kojipkgs.fedoraproject.org/packages/glib2/2.22.4/1.fc12/data/logs/i68...
we seem to have things set up to run configure as:
--build=i386-redhat-linux-gnu --host=i386-redhat-linux-gnu --target=i686-redhat-linux-gnu
This comes from the rpm %configure macro, which hasn't changed:
./configure --build=%{_build} --host=%{_host} \\ --target=%{_target_platform} \\
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Bill
On Mon, 1 Feb 2010, Bill Nottingham wrote:
Owen Taylor (otaylor@redhat.com) said:
Looking at the build logs for F-12, e.g.:
http://kojipkgs.fedoraproject.org/packages/glib2/2.22.4/1.fc12/data/logs/i68...
we seem to have things set up to run configure as:
--build=i386-redhat-linux-gnu --host=i386-redhat-linux-gnu --target=i686-redhat-linux-gnu
This comes from the rpm %configure macro, which hasn't changed:
./configure --build=%{_build} --host=%{_host} \\ --target=%{_target_platform} \\
More precisely it comes from redhat-rpm-config which overrides rpm's own %configure macro.
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Yup, and all wonderfully mixed up - rpm's idea of --target is something completely different from what auto*foo from this century thinks of it. Dunno if it ever was really valid but certainly not anymore.
rpm >= 4.8.0 no longer sets the --target on %configure but that's been masked by the redhat-rpm-config version of %configure. That's been fixed too as of today.
- Panu -
Panu Matilainen (pmatilai@laiskiainen.org) said:
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Yup, and all wonderfully mixed up - rpm's idea of --target is something completely different from what auto*foo from this century thinks of it. Dunno if it ever was really valid but certainly not anymore.
rpm >= 4.8.0 no longer sets the --target on %configure but that's been masked by the redhat-rpm-config version of %configure. That's been fixed too as of today.
Is either %_host or %_build set based on --target?
Bill
On Tue, 2 Feb 2010, Bill Nottingham wrote:
Panu Matilainen (pmatilai@laiskiainen.org) said:
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Yup, and all wonderfully mixed up - rpm's idea of --target is something completely different from what auto*foo from this century thinks of it. Dunno if it ever was really valid but certainly not anymore.
rpm >= 4.8.0 no longer sets the --target on %configure but that's been masked by the redhat-rpm-config version of %configure. That's been fixed too as of today.
Is either %_host or %_build set based on --target?
No... as there's no correct way to map rpm's --target to autotools expectations. --target does affect the optimization flags and bits like %{_libdir} value, so for the average --target i686 vs --target i386 style usage you'll get more or less what you'd expect.
To put some sense into it requires turning the whole concept upside down in rpm, adding some new switches and most likely breaking some formerly "working" setups in the process.
The whole host, build, target-triplet is three-way mixed up in rpm. With autotools --target out of the way for now, one possibility could be making changing what's currently %_host into %_build, and what's currently %_target into %_host. This would be correct (AFAICT) for native builds for default architecture, and "build arm binaries on x86" type of cross-builds.
That's not correct for "sub-arch" builds, such as compiling i386 optimized binaries on i686 or i686 binaries on x86_64, as these are not cross-builds, and autotools will complain something like:
checking build system type... x86_64-redhat-linux-gnu checking host system type... i686-redhat-linux-gnu checking target system type... i686-redhat-linux-gnu ... checking for i686-redhat-linux-strip... no checking for strip... strip configure: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org.
Another perhaps saner option would be changing what's currently %_host into %_build, taking --host switch out of default %configure flags and add a --host switch to rpmbuild, to be used for real cross-builds. And leave rpmbuild's --target more or less alone, ie it mostly means "optimize for this cpu". Would break some setups for sure, but I dont really see how it could be changed without breaking the 10+ years worth of broken "working" usage.
Better ideas would be most welcome.
- Panu -
On 02/03/2010 10:05 AM, Panu Matilainen wrote:
On Tue, 2 Feb 2010, Bill Nottingham wrote:
Panu Matilainen (pmatilai@laiskiainen.org) said:
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Yup, and all wonderfully mixed up - rpm's idea of --target is something completely different from what auto*foo from this century thinks of it. Dunno if it ever was really valid but certainly not anymore.
rpm>= 4.8.0 no longer sets the --target on %configure but that's been masked by the redhat-rpm-config version of %configure. That's been fixed too as of today.
Is either %_host or %_build set based on --target?
No... as there's no correct way to map rpm's --target to autotools expectations.
There is: rpm's --target is autoconf's --host
except for packages which screw up with --build, --host, --target.
Ralf
On Wed, 3 Feb 2010, Ralf Corsepius wrote:
On 02/03/2010 10:05 AM, Panu Matilainen wrote:
On Tue, 2 Feb 2010, Bill Nottingham wrote:
Panu Matilainen (pmatilai@laiskiainen.org) said:
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Yup, and all wonderfully mixed up - rpm's idea of --target is something completely different from what auto*foo from this century thinks of it. Dunno if it ever was really valid but certainly not anymore.
rpm>= 4.8.0 no longer sets the --target on %configure but that's been masked by the redhat-rpm-config version of %configure. That's been fixed too as of today.
Is either %_host or %_build set based on --target?
No... as there's no correct way to map rpm's --target to autotools expectations.
There is: rpm's --target is autoconf's --host
Yes, that's what would be the clean mapping. But as I said in the latter part (which you cut out here): much/most of the time rpm's --target is used to specify sub-architecture optimization levels (--target i686 on i386 or --target i686 on x86_64) which aren't cross-compiles. Just mapping rpm's --target to autoconf --host causes autoconf to complain in these situations.
I dont feel quite confortable to changing it to something that causes "this will not be supported in future" and other warnings.
- Panu -
On 02/03/2010 02:20 PM, Panu Matilainen wrote:
On Wed, 3 Feb 2010, Ralf Corsepius wrote:
On 02/03/2010 10:05 AM, Panu Matilainen wrote:
On Tue, 2 Feb 2010, Bill Nottingham wrote:
Panu Matilainen (pmatilai@laiskiainen.org) said:
%{_host} is set by the rpm package in the macros file, %{_build} defaults to the value of %{_host}. %{_target_platform} comes from --target on the command line, plus the usual vendor/OS bits
--target is what is set by rpm/mock. I think it defaults to %{_host} if it's not otherwise specified, but we specify it when building for i686, as we could theoretically still build i386 packages.
Yup, and all wonderfully mixed up - rpm's idea of --target is something completely different from what auto*foo from this century thinks of it. Dunno if it ever was really valid but certainly not anymore.
rpm>= 4.8.0 no longer sets the --target on %configure but that's been masked by the redhat-rpm-config version of %configure. That's been fixed too as of today.
Is either %_host or %_build set based on --target?
No... as there's no correct way to map rpm's --target to autotools expectations.
There is: rpm's --target is autoconf's --host
Yes, that's what would be the clean mapping. But as I said in the latter part (which you cut out here):
I am aware about these issue. As you might recall, I am cross-building rpms and canadian crossbuilding rpms for many years.
The rpm-specs I am using for this are cluttered with clutches to work around rpm's / redhat-rpm-config's brokeness wrt. rpm's --target handling ;)
much/most of the time rpm's --target is used to specify sub-architecture optimization levels (--target i686 on i386 or --target i686 on x86_64) which aren't cross-compiles. Just mapping rpm's --target to autoconf --host causes autoconf to complain in these situations.
Have a closer look: It only complains about bogus arguments being used.
As long as you manage to derive CFLAGS/CPPFLAGS/CXXFLAGS etc. from rpm's --target, these autoconf checks currently fall back to what you expect.
I dont feel quite confortable to changing it to something that causes "this will not be supported in future" and other warnings.
Well, there are several work arounds:
a) Not using any of --build or --host unless --target is passed to rpm This would be the ultimate solution .
b) Explicitly pass --build="rpm's target" == --host == "rpm's target". This suppresses the configure check because autoconf presumes the invoker to "know what he does".
Ralf
On Mon, 2010-02-01 at 18:24 -0500, Owen Taylor wrote:
we seem to have things set up to run configure as:
--build=i386-redhat-linux-gnu --host=i386-redhat-linux-gnu --target=i686-redhat-linux-gnu
Which, according to my reading of the autoconf manual means:
- Build on a i386-redhat-linux-gnu
- Create code that runs on i386-redhat-linux-gnu
- Build a cross tool chain that targets i686-redhat-linux-gnu
and really doesn't make sense. I'm pretty sure we want to pass i686-redhat-linux-gnu for --host, and we don't need to specify --target.
(clip)
Am I missing something here? This is causing GLib to build using slow fallbacks for atomic operations, and likely causes other problems as well.
I've had some problems as well with pcc where using %configure makes the build process think a cross compilation should be done.