Subject: Re: Build problems for liboil on netbsd-macppc
To: None <>
From: Marco Righele <>
List: pkgsrc-users
Date: 09/05/2006 00:27:32
On Sun, 3 Sep 2006 23:56:55 +0200
Georg Schwarz <> wrote:
> you might at least consider to ad a for the package in  
> question which could contain something like
> .if ${OPSYS} == Darwin && {PKGSRC_COMPILER} == gcc && exists(/usr/bin/ 
> machine)
> _CPUTYPE!=	/usr/bin/machine
> . if "${_CPUTYPE}" == "ppc7400" || "${_CPUTYPE}" == "ppc970" # G4 or G5
> PKG_HACKS+=	enable-altivec
> CFLAGS+=	-maltivec
> . endif
> .endif

Thanks for answering. /usr/bin/machine seems to be pretty generic on my machine ('macppc'), so I used the following I don't know if there's a better way to detect altivec, but it does work for me.

.if ${OPSYS} == NetBSD && ${PKGSRC_COMPILER} == gcc && exists(/usr/bin/machine) && exists(/sbin/sysctl)
_CPUTYPE!=      /usr/bin/machine
. if "${_CPUTYPE}" == "macppc"
_HAS_ALTIVEC!=  /sbin/sysctl -n machdep.altivec
.  if "${_HAS_ALTIVEC}" == "1"
PKG_HACKS+=     enable-altivec
CFLAGS+=        -maltivec
.  endif
. endif

In any case, I think it's a bug in liboil, given that the -maltivec flag is added during the altivec test, but not during the build phase, or am I wrong ?
I have somehow resolved the relocation issues that I described earlier (Unsupported relocation type 10 in non-PLT relocations). There are only a couple of functions that use that type of relocation, and they are both assembler-optimized-altivec-version of memcpy and memset, so I axed them out, and got rid of those messages.
While the fix is pretty small (a line changed in a it involves rerunning automake. How should this be handled, making a big patch for all the files changed after the rerun of automake ?
(I know this is not exactly 'fixing' the problem, but it's what I can do for now, at least until I can get some advice from someone more expert, maybe on the liboil ml ).


Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive