Laca:
Thanks for your comments. I updated the SUNWliboil.spec file as you
suggested and it works well with these changes. I also updated the
patch so that this if-test:
+ if (ui & !AV_386_FXSR) {
was changed to this:
+ if (!(ui & AV_386_FXSR)) {
Since James Chang of the mediaLib team caught that the original way
wouldn't work properly in code review.
Brian
> This is still not good:
>
> export PKG_CONFIG_PATH=%{_pkg_config_path}
> export MSGFMT="/usr/bin/msgfmt"
> export ACLOCAL_FLAGS="-I %{_datadir}/aclocal"
> export PERL5LIB=%{_prefix}/perl5/site_perl/5.6.1/sun4-solaris-64int
> export RPM_OPT_FLAGS="$CFLAGS"
> export LDFLAGS="%_ldflags"
> #ifarch amd64 i386
> export CC=gcc
> #endif
>
> 1) you don't need to set MSGFMT, ACLOCAL_FLAGS and PERL5LIB, but
> that's not really important
> 2) #ifarch is a comment in a spec file, should be %ifarch
> Same problem around the BuildRequires: SUNWgcc line.
> Including both amd64 and i386 is redundant, amd64 platforms
> match i386. (pkgbuild uses the output of isainfo)
> 3) this will set RPM_OPT_FLAGS to CFLAGS, which isn't set anywhere
> in the spec file, so it'll pick up whatever is in the build user's
> environment (note: liboil.spec sets CFLAGS=$RPM_OPT_FLAGS).
>
> Normally, in our official builds CFLAGS is not set in the
> environment, so this means that it'll use gcc's / sun cc's defaults.
>
> I suggest that you change above to this:
>
> export PKG_CONFIG_PATH=%{_pkg_config_path}
> export CFLAGS="%optflags"
> export LDFLAGS="%_ldflags"
> %ifarch i386
> export CC=gcc
> export CFLAGS="-O2 -march=i586 -Xlinker -i -fno-omit-frame-pointers -fPIC
> -DPIC
> %endif
> export RPM_OPT_FLAGS="$CFLAGS"
>
> This will set the usual CFLAGS when built of sparc and the default
> gcc specific CFLAGS (as set in Solaris.inc) for intel.
>
> Laca
>
> On Fri, 2007-02-09 at 18:33 +0800, Brian Cameron wrote:
>> Damien:
>>
>> Thanks for catching this. The setting of CFLAGS was cruft and removing
>> the setting of CFLAGS completely from the spec file also works just
>> fine. I updated the spec-file in SVN head so we no longer set CFLAGS
>> in the spec-file.
>>
>> Brian
>>
>>
>>> I don't understand this change:
>>> -export CFLAGS="%optflags -I%{_includedir}"
>>> +export CFLAGS="$CFLAGS -I%{_includedir}"
>>>
>>> It's not inside any %ifarch/%endif block so %optflags aren't used for
>>> either architecture.
>>> If some of the flags in %optflags are not compatible with gcc I could
>>> understand something like:
>>>
>>> %ifarch amd64 i386
>>> export CFLAGS="$CFLAGS -I%{_includedir}"
>>> %else
>>> export CFLAGS="%optflags -I%{_includedir}"
>>> %endif
>>>
>>> Is "-I%{_includedir}" necessary? Isn't it searched by default? (I know that
>>> it is not your addition)
>>>
>>> Damien
>>>
>>> ----- Original Message -----
>>> From: Brian Cameron <Brian.Cameron at Sun.COM>
>>> Date: Friday, February 9, 2007 5:25 am
>>> Subject: [jds-review] liboil improvements
>>> To: JDS-Review at opensolaris.org
>>>
>>>> The attached change to liboil causes it to be built with GCC when
>>>> building on x86 platforms, so that hardware acceleration support is
>>>> enabled. The new patch uses the getisax(2) kernel function so that
>>>> hardware acceleration support is determined using the correct Solaris
>>>> kernel interface.
>>>>
>>>> I have verified that liboil functions are 4-6 times faster using
>>>> GCC so that the GCC-style assembly code for hardware acceleration
>>>> gets compiled, and we don't just use the default C-implementations.
>>>>
>>>> Brian
>>>>
>>>>
>>>>
>