Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538374 - sys-apps/baselayout-prefix: libeinfo does not compile with altivec enabled
Summary: sys-apps/baselayout-prefix: libeinfo does not compile with altivec enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-31 21:49 UTC by Michael Weiser
Modified: 2015-03-02 10:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weiser 2015-01-31 21:49:57 UTC
merging of baselayout-prefix fails with this error on OS X 10.5.8 PPC:

/Users/michael/Gentoo/bin/bash ../../libtool  --tag=CC   --mode=compile powerpc-apple-darwin9-gcc -DHAVE_CONFIG_H -I. -I../..  -I./../includes   -O2 -pipe -MT libeinfo_la-libeinfo.lo -MD -MP -MF .deps/libeinfo_la-libeinfo.Tpo -c -o libeinfo_la-libeinfo.lo `test -f 'libeinfo.c' || echo './'`libeinfo.c
libtool: compile:  powerpc-apple-darwin9-gcc -DHAVE_CONFIG_H -I. -I../.. -I./../includes -O2 -pipe -MT libeinfo_la-libeinfo.lo -MD -MP -MF .deps/libeinfo_la-libeinfo.Tpo -c libeinfo.c  -fno-common -DPIC -o .libs/libeinfo_la-libeinfo.o
libeinfo.c:153: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'term_is_cons25'
libeinfo.c:236: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'yesno'
libeinfo.c:261: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'noyes'
libeinfo.c:277: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'is_quiet'
libeinfo.c:283: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'is_verbose'
libeinfo.c:355: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'colour_terminal'
libeinfo.c: In function '_eend':
libeinfo.c:834: error: 'term_is_cons25' undeclared (first use in this function)
libeinfo.c:834: error: (Each undeclared identifier is reported only once
libeinfo.c:834: error: for each function it appears in.)
Makefile:422: recipe for target 'libeinfo_la-libeinfo.lo' failed

This is because altivec is enabled in gcc-apple by default which makes bool be defined as bool:

michael@osx105 ~ $ gcc -E -dM t.c | grep bool
#define bool bool
#define __bool __attribute__((altivec(bool__))) unsigned
michael@osx105 ~ $ gcc -E -dM -mno-altivec t.c | grep bool
michael@osx105 ~ $ 

Consequently, adding -mno-altivec to CFLAGS makes libeinfo compile and baselayout-prefix merge.

This small test case demonstrates the problem:

michael@osx105 ~ $ cat t.c
#ifndef bool
typedef int bool;
#endif
bool s = 1;
michael@osx105 ~ $ gcc -c -o t.o t.c
t.c:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 's'
michael@osx105 ~ $ gcc -mno-altivec -c -o t.o t.c
michael@osx105 ~ $ 

Including stdbool.h fixes the problem as well:

michael@osx105 ~ $ cat t.c
#include <stdbool.h>
#ifndef bool
typedef int bool;
#endif
bool s = 1;
michael@osx105 ~ $ gcc -c -o t.o t.c
michael@osx105 ~ $ gcc -mno-altivec -c -o t.o t.c


Reproducible: Always
Comment 1 Fabian Groffen gentoo-dev 2015-02-02 08:39:21 UTC
Hmmm, we removed stdbool.h in
http://rsync8.prefix.bitzolder.nl/hg/einfo/rev/eadda93bc438
Comment 2 Michael Weiser 2015-02-02 17:45:46 UTC
Well, I guess we could always do:

#ifdef bool
#undef bool
#endif
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif

Just tried it and it compiles.
Comment 3 Fabian Groffen gentoo-dev 2015-02-28 14:09:15 UTC
Can you try with baselayout-prefix-2.2-r4?  I've removed einfo from that release
Comment 4 Michael Weiser 2015-03-01 09:22:56 UTC
It installs fine and all seems to be well. Thanks!