Bug 449944
Summary: | AC_C_BIGENDIAN macro is badly broken | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Adam Tkac <atkac> | ||||
Component: | autoconf | Assignee: | Stepan Kasal <kasal> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | low | ||||||
Version: | rawhide | CC: | ovasik | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | ppc64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | 2.62-4.fc10 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2008-07-05 18:35:58 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 453566 | ||||||
Attachments: |
|
Description
Adam Tkac
2008-06-04 12:31:18 UTC
Created attachment 308336 [details]
testcase
Try compile attached testcase on ppc64, it fails. With older autoconf (2.61)
should be successful
Also as written in autoconf manual: In some cases a single run of a compiler can generate code for multiple architectures. This can happen, for example, when generating Mac OS X universal binary files, which work on both PowerPC and Intel architectures. In this case, the different variants might be for different architectures whose endiannesses differ. If configure detects this, it executes action-if-universal instead of action-if-unknown. I don't think that our ppc64 gcc is able to produce little-endian code especially when endianess macros are defined directly by preprocessor. > I look onto AC_C_BIGENDIAN macro definition it does simple test > #if (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__) => platform has universal endian. > I don't think this simple and weird test is good. I agree with you that this is a bug. The idea was that config.h contains #ifdef __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 #endif so we do not need more compilations. This is a nice optimization for the case when AC_C_BIGENDIAN was called without parameters. But, obviously, it breaks your test case: AC_C_BIGENDIAN([AC_DEFINE(BIG, 1, [big])], [AC_DEFINE(LITTLE, 1, [little])]) I'll report that to bug-autoconf. autoconf-2.62-4.fc10 contains patch which disables the unfortunate attempt to support universal binaries. If a configure script is affected by this bug in autoconf-2.62, you can workaround the bug by fixing the configure script like this: sed -i 's/ac_c_bigendian/: &/' ./configure |