NetBSD Problem Report #44610

From  Sun Feb 20 07:27:28 2011
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id CF1C863B11D
	for <>; Sun, 20 Feb 2011 07:27:27 +0000 (UTC)
Message-Id: <>
Date: Sun, 20 Feb 2011 07:27:26 +0000 (UTC)
Subject: multimedia/x264-devel fails to build on sparc/solaris 9 with ABI=64
X-Send-Pr-Version: www-1.0

>Number:         44610
>Category:       pkg
>Synopsis:       multimedia/x264-devel fails to build on sparc/solaris 9 with ABI=64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 20 07:30:00 +0000 2011
>Last-Modified:  Sun Mar 27 19:00:19 +0000 2011
>Originator:     Stefan
>Release:        sparc/solaris 9
Solaris 9/sparc
multimedia/x264-devel fails to build on sparc/solaris 9 with ABI=64 (2010Q4)

libtool: link: gcc -shared -Wl,-z -Wl,text -Wl,-h -Wl, -o .libs/  common/.libs/mc.o common/.libs/predict.o common/.libs/pixel.o common/.libs/macroblock.o common/.libs/frame.o common/.libs/dct.o common/.libs/cpu.o common/.libs/cabac.o common/.libs/common.o common/.libs/mdate.o common/.libs/set.o common/.libs/quant.o common/.libs/vlc.o encoder/.libs/analyse.o encoder/.libs/me.o encoder/.libs/ratecontrol.o encoder/.libs/set.o encoder/.libs/macroblock.o encoder/.libs/cabac.o encoder/.libs/cavlc.o encoder/.libs/encoder.o encoder/.libs/lookahead.o extras/.libs/getopt.o common/sparc/.libs/pixel.o   -lm -lpthread -lrt -L/usr/pkgsrc/tmp/multimedia/x264-devel/work/.buildlink/lib -lc  -Wl,-R/usr/local/lib -mcpu=ultrasparc  
ld: fatal: file common/sparc/.libs/pixel.o: wrong ELF class: ELFCLASS32
ld: fatal: File processing errors. No output written to .libs/
collect2: ld returned 1 exit status
gmake: *** [] Error 1

Under the hood:

<.> /usr/ccs/bin/as -xarch=v8plusa -D__PIC__ common/sparc/pixel.asm -o common/sparc/.libs/pixel.o 
[*] /usr/pkgsrc/tmp/multimedia/x264-devel/work/.wrapper/bin/as /usr/pkgsrc/tmp/multimedia/x264-devel/work/.wrapper/bin/as -xarch=v8plusa -D__PIC__ common/sparc/pixel.asm -o common/sparc/pixel.o

v8plusa is passed to as. This is so set in configure (grep for v8plusa) and must be patched to be set to v9a when ABI=64 is set in mk.conf.

(The assembler file is written with VIS extentions and v9 is not enough. v9a is necessary.)

Then, the final link fails as well:

libtool  --mode=link gcc -o x264 x264.lo matroska.lo muxers.lo -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/local/lib -lm -mcpu=ultrasparc  -lpthread -lrt -s
libtool: link: gcc -o .libs/x264 .libs/x264.o .libs/matroska.o .libs/muxers.o -Wl,-R/usr/local/lib -mcpu=ultrasparc -s  ./.libs/ -L/usr/pkgsrc/tmp/multimedia/x264-devel/work/.buildlink/lib -lm -lpthread -lrt  -R/usr/local/lib
Undefined                       first referenced
 symbol                             in file
logf                                ./.libs/
getopt_long                         .libs/x264.o

logf is not available on solaris 9. Not 100% sure, but I think it's available on solaris 10.

logf is from float to float while log is from double to double. How about using log instead of logf, at least for solaris 9?

configure sets HAVE_GETOPT_LONG to 0, so Makefile is adding 

ifneq ($(HAVE_GETOPT_LONG),1)
SRCS += extras/getopt.c

getopt_long is not included in extra/getopt.o object file. It's only included if _MSC_VER is defined (see extras/getopt.c source code). _MSC_VER seems to be the microsoft c compiler version number macro. Setting it to a random value (#define) makes the library link under solaris :)



[20110327 shattered] edited Environment: field

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-When: Sun, 20 Feb 2011 14:21:24 +0000
Solaris pkgsrc problem.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.