You are not logged in.

#1 2011-02-03 21:26:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,729
Website

resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

I'm experiencing a very odd error when I try to build the nvidia package.  I have added the following two lines which simply redefine the CFLAGS and CXXFLAGS:

CFLAGS="-march=x86_64 -mtune=generic -O2 -pipe"
CXXFLAGS="${CFLAGS}"

When I issue the standard makepkg -s I am presented with this very odd error:

==> Starting build()...
Creating directory NVIDIA-Linux-x86_64-260.19.36-no-compat32
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 260.19.36.....................................................................................................................
The kernel you are installing for is a Xen kernel!

The NVIDIA driver does not currently work on Xen kernels. If 
you are using a stock distribution kernel, please install 
a variant of this kernel without Xen support; if this is a 
custom kernel, please install a standard Linux kernel.  Then 
try installing the NVIDIA kernel module again.

*** Failed Xen sanity check. Bailing out! ***

make[1]: *** [build-sanity-checks] Error 1
make: *** [module] Error 2
    Aborting...

If I comment those two lines out, it builds just fine... what is up?

PKGBUILD:

# $Id: PKGBUILD 107170 2011-01-21 21:50:12Z ibiru $
# Maintainer : Thomas Baechler <thomas@archlinux.org>

pkgname=nvidia
pkgver=260.19.36
_kernver='2.6.37-ARCH'
pkgrel=2
pkgdesc="NVIDIA drivers for kernel26."
arch=('i686' 'x86_64')
url="http://www.nvidia.com/"
depends=('kernel26>=2.6.37' 'kernel26<2.6.38' "nvidia-utils=${pkgver}")
makedepends=('kernel26-headers>=2.6.37' 'kernel26-headers<2.6.38')
conflicts=('nvidia-96xx' 'nvidia-173xx')
license=('custom')
install=nvidia.install

if [ "$CARCH" = "i686" ]; then
    _arch='x86'
    _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
        source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
        md5sums=('2826484d87827351774449382e45c4a9')
elif [ "$CARCH" = "x86_64" ]; then
    _arch='x86_64'
    _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
        source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
        md5sums=('6ebc5db9066e920b0b0e48377ce5eeb5')
fi

build() {
    cd $srcdir
    sh ${_pkg}.run --extract-only
    cd ${_pkg}/kernel

        # reset to defaults
        CFLAGS="-march=x86_64 -mtune=generic -O2 -pipe"
        CCXFLAGS="${CFLAGS}"
     make SYSSRC=/lib/modules/${_kernver}/build module
}

package() {
    install -D -m644 $srcdir/${_pkg}/kernel/nvidia.ko \
        $pkgdir/lib/modules/${_kernver}/kernel/drivers/video/nvidia.ko
        install -d -m755 $pkgdir/etc/modprobe.d
        echo "blacklist nouveau" >> $pkgdir/etc/modprobe.d/nouveau_blacklist.conf
    sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" $startdir/nvidia.install
}

Last edited by graysky (2011-02-05 10:40:55)

Offline

#2 2011-02-03 21:31:59

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,653
Website

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

Not that this should be making a difference:

There is a typo in the PKGBUILD:

CCXFLAGS="${CFLAGS}"

Offline

#3 2011-02-03 21:36:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,729
Website

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

@Allan - good catch.  But you're right, it seems as though this nvidia package doesn't tolerate me making this change.  I have done this successfully with many other packages.  Is there a method to clear the values for those two variables, then assign them or am I barking up the wrong tree?

Offline

#4 2011-02-03 21:47:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,653
Website

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

Well...  it should work...   try adding "export" in front of those lines.

Offline

#5 2011-02-03 22:04:59

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,729
Website

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

@Allan - tried your suggestion but the result was the same... perhaps I should kill the line in the Makefile that calls that xen check and call it good?

Offline

#6 2011-02-03 22:51:23

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

Simple logical reasoning: You are using what is meant to be the default settings in /etc/makepkg.conf. If something breaks, that means what you are using in the PKGBUILD does not match with the defaults.

This line:

CFLAGS="-march=x86_64 -mtune=generic -O2 -pipe"

Should be:

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"

flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#7 2011-02-03 23:01:18

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,668

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

dyscoria wrote:

This line:

CFLAGS="-march=x86_64 -mtune=generic -O2 -pipe"

Should be:

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"

Shheesh seems difficult to resolve that difference from here

Offline

#8 2011-02-03 23:12:42

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

skunktrader wrote:

Shheesh seems difficult to resolve that difference from here

Yes, tiny mistakes like this are easy to make. I guess that's why Linux From Scratch repeats multiple times in their guide to copy/paste instead of writing out commands.

Last edited by dyscoria (2011-02-03 23:13:16)


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#9 2011-02-04 23:47:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,729
Website

Re: resetting CFLAGS and CXXFLAGS in a PKGBUILD kills makepkg [solved]

skunktrader wrote:
dyscoria wrote:

This line:

CFLAGS="-march=x86_64 -mtune=generic -O2 -pipe"

Should be:

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"

Shheesh seems difficult to resolve that difference from here

You're right (good eye).  Works fine now.  Thanks!

Last edited by graysky (2011-02-04 23:49:16)

Offline

Board footer

Powered by FluxBB