compilation fails on CentOS 5.5

Bug #620327 reported by Miika Komu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HIPL
Fix Released
High
Unassigned

Bug Description

Compilation fails on CentOS 5.5:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 -std=c99 -Wall -Wextra -Werror -Wredundant-decls -Wdisabled-optimization -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wno-deprecated-declarations -Wpointer-arith -Wwrite-strings -Wshadow -Winline -fno-strict-aliasing -g -O2 -MT lib/core/message.lo -MD -MP -MF lib/core/.deps/message.Tpo -c lib/core/message.c -o lib/core/message.o
In file included from ./lib/tool/nlink.h:8,
                 from lib/core/message.c:89:
/usr/include/linux/xfrm.h:68: error: expected specifier-qualifier-list before ‘__u64’
/usr/include/linux/xfrm.h:80: error: expected specifier-qualifier-list before ‘__u64’

It seems that __u16 and __u32 get compiled but __u64 not (checked with gcc -E flag on CentOS). The __u64 seems to be define only in one place:

/usr/include/asm/types.h
..
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#endif

The problem is that __STRICT_ANSI__ is defined. Work in progress...

Revision history for this message
René Hummen (rene-hummen) wrote :

Who is currently looking into this issue? It would be nice if someone in Helsinki would volunteer, as we don't have any configured CentOS systems.

Changed in hipl:
importance: Undecided → High
Revision history for this message
Miika Komu (miika-iki) wrote :

I have zarroo time for this issue this week. I can give access to the CentOS machine, if you're in a hurry.

Revision history for this message
Diego Biurrun (diego-biurrun) wrote :

What kernel version and kernel header version is that? I have the following in /usr/include/linux/types.h:
typedef __u64 __bitwise __be64;

Revision history for this message
Miika Komu (miika-iki) wrote :

[hipl@hellfire trunk]$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.5 (Final)
Release: 5.5
Codename: Final
[hipl@hellfire trunk]$ uname -a
Linux hellfire.infrahip.net 2.6.18-194.17.1.el5 #1 SMP Wed Sep 29 12:51:33 EDT 2010 i686 i686 i386 GNU/Linux

/usr/include/linux/types.h:

#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __u64 uint64_t;
typedef __u64 u_int64_t;
typedef __s64 int64_t;
#endif

/* this is a special 64bit data type that is 8-byte aligned */
#define aligned_u64 unsigned long long __attribute__((aligned(8)))

#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __u64 __bitwise __le64;
typedef __u64 __bitwise __be64;
#endif

Revision history for this message
Diego Biurrun (diego-biurrun) wrote :

CPPFLAGS=-U__STRICT_ANSI__ ./configure

does the trick for me on the test system Miika provided. Is that workaround sufficient?

Revision history for this message
Miika Komu (miika-iki) wrote :

It is ok assuming that we can note this in INSTALL (and perhaps manual) and add it to packaging/hipl-rpm.spec:

%build
..
# The ANSI workaround is for CentOS 5.5 (see bug id 620327 in launchpad). Seems to work also for Fedora.
CPPFLAGS=-U__STRICT_ANSI__ configure --prefix=/usr
..

Note that the change affects also Fedora which does not suffer from this problem. However, I tested it to compile successfully with the above fix.

Probably the best solution would be to do some distro detection during configure, but this would work for me.

Revision history for this message
Diego Biurrun (diego-biurrun) wrote :

I would suggest not adding this workaround for the general case of building RPM packages, but just to document how you can work around it when building CentOS 5.5 packages. The problem is likely to go away in the next CentOS release. I have committed something to the INSTALL file. I don't know what would have to be done to apply the workaround to building RPM packages, somebody who knows this, please extend the description.

Changed in hipl:
status: New → Fix Committed
Revision history for this message
Miika Komu (miika-iki) wrote :

Applied to RPM building in revision 4990.

Revision history for this message
Miika Komu (miika-iki) wrote :

If everybody is happy with the fix, I would suggest to close this bug.

Changed in hipl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.