You are not logged in.

#1 2005-02-15 17:36:20

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 226

problem with building memtest86

I wrote pkgbuild:

# Maintainer: Abaddon <kukububu@go2.pl>
pkgname=memtest86
pkgver=3.2
pkgrel=1
pkgdesc="Memtest86 is stand alone memory test for x86 architecture computers."
url="http://www.memtest86.com/"
depends=('')
source=(http://www.memtest86.com/$pkgname-$pkgver.tar.gz)
md5sums=('46028d276c39c2eebe7759ba813f97df')

build() {
cd $startdir/src/$pkgname-$pkgver
make || return 1
make prefix=$startdir/pkg/usr install
}

It won't compile.

==> Making package: memtest86  (wto lut 15 18:35:39 CET 2005)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==>     Using local copy of memtest86-3.2.tar.gz
==> Validating source files with MD5sums
    memtest86-3.2.tar.gz ... Passed
==> Extracting Sources...
==>     tar --use-compress-program=gzip -xf memtest86-3.2.tar.gz
==> Starting build()...
gcc -E -m32 -traditional head.S -o head.s
as -32 -o head.o head.s
gcc -c -m32 -fPIC -Wall -O -fno-strict-aliasing reloc.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC main.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC init.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC lib.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC patn.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC screen_buffer.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC config.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC linuxbios.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC memsize.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC pci.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC controller.c
gcc    -c -o random.o random.c
gcc -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC extra.c
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o random.o extra.o && 
ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o random.o extra.o
__i686.get_pc_thunk.bx: discarded in section `.gnu.linkonce.t.__i686.get_pc_thunk.bx' from reloc.o
make: *** [memtest_shared] Błąd 1
==> ERROR: Build Failed.  Aborting...

Could anyone help me?


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#2 2005-02-16 11:14:09

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 226

Re: problem with building memtest86

Maybe someone can try this pkgbuild? I want to know if it's only mine problem.

Thx in advance.


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#3 2005-02-16 16:01:38

JimboP
Member
From: UK
Registered: 2005-01-14
Posts: 22

Re: problem with building memtest86

Just tried and get the same error - no idea how to fix unfortunately!

Offline

#4 2005-02-16 17:39:40

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: problem with building memtest86

The reloc.c  file is probably compiled with the default Arch Linux CFLAGS (-march=i686) While the rest of the source is compiled with -march=i486.  In the Makefile,  change -march=i486 by -march=i686.  (You can use  sed in your PKGBUILD)

It might be the problem since the error happens when the objects files are  linked.

Offline

#5 2005-02-16 18:10:24

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 226

Re: problem with building memtest86

I used:

sed -i 's/i486/i686/g' Makefile

but, it doesn't help:

==> Making package: memtest86  (śro lut 16 19:08:29 CET 2005)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==>     Using local copy of memtest86-3.2.tar.gz
==> Validating source files with MD5sums
    memtest86-3.2.tar.gz ... Passed
==> Extracting Sources...
==>     tar --use-compress-program=gzip -xf memtest86-3.2.tar.gz
==> Starting build()...
gcc -E -m32 -traditional head.S -o head.s
as -32 -o head.o head.s
gcc -c -m32 -fPIC -Wall -O -fno-strict-aliasing reloc.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC main.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC init.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC lib.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC patn.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC screen_buffer.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC config.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC linuxbios.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC memsize.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC pci.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC controller.c
gcc -Os -march=athlon-tbird -mtune=athlon-tbird -pipe -fomit-frame-pointer -ffast-math -mmmx -m3dnow -fmove-all-movables -s -DNDEBUG -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS   -c -o random.o random.c
gcc -c -Wall -march=i686 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC extra.c
ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o random.o extra.o && 
ld -shared -Bsymbolic -T memtest_shared.lds -o memtest_shared head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o config.o linuxbios.o memsize.o pci.o controller.o random.o extra.o
__i686.get_pc_thunk.bx: discarded in section `.gnu.linkonce.t.__i686.get_pc_thunk.bx' from reloc.o
__i686.get_pc_thunk.cx: discarded in section `.gnu.linkonce.t.__i686.get_pc_thunk.cx' from main.o
make: *** [memtest_shared] Błąd 1
==> ERROR: Build Failed.  Aborting...
┌─(ROOT@194-4:pts/2)───────────────────

Adding -march=i686 to compilong reloc.c also doesn't help.

I dunno what to do...


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#6 2005-02-16 20:39:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: problem with building memtest86

maybe compile the whole thing as i486?

Offline

#7 2005-02-16 22:19:31

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: problem with building memtest86

Looks like this can be patched (sorry I have no time to do it now myself):
This is the spec file from PLD:
http://cvs.pld-linux.org/cgi-bin/cvsweb … c?rev=1.29
It includes 2 patches. One of them is "-i686-ld.patch" which I think is what you are looking for.
I think you should be able to download thes patches here:
http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/
Maybe also gentoo ebuild will be helpful too:
http://gentoo-portage.com/ebuild?e=sys- … 3.2.ebuild
I hope this will help (I want this tool too :-)) so good luck.

EDIT: It's always a good idea to check what other distros do about this kind of problems. I usually use PLD, Gentoo or Sourcemage "pkgbuilds" when I'm lookin for a help.

Offline

#8 2005-02-17 08:09:52

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 226

Re: problem with building memtest86

I've tried using patches form gentoo, but they don't solve problem. I'm gonna check patches from pld when I'll come back home form school.


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#9 2005-02-17 18:50:51

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 226

Re: problem with building memtest86

# Maintainer: Abaddon <kukububu@go2.pl>
pkgname=memtest86
pkgver=3.2
pkgrel=1
pkgdesc="Memtest86 is stand alone memory test for x86 architecture computers."
url="http://www.memtest86.com/"
depends=('')
source=(http://www.memtest86.com/$pkgname-$pkgver.tar.gz)
md5sums=('46028d276c39c2eebe7759ba813f97df')

build() {
cd $startdir/src/$pkgname-$pkgver
sed -i 's/i486/i686/g' Makefile
perl -pi -e 's/*(.text.*)n/*(.text.*)n*(.gnu.linkonce.t.*)n/' memtest_shared.lds
make || return 1
mkdir /boot/memtest86/
cp memtest.bin /boot/memtest86/memtest.bin
}

It builds memtest.bin and copys it into /boot/memtest86/. What I have to do to inject memtest.bin into package? (From this build, makepkg makes empty package...). memtest.bin should be installed into /boot/memtest86/memtest.bin

Thx in advance.


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

#10 2005-02-17 21:01:52

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: problem with building memtest86

Replace 

mkdir /boot/memtest86/
cp memtest.bin /boot/memtest86/memtest.bin 

by:

install -D -m755 memtest.bin  $startdir/pkg/boot/memtest86/memtest.bin

It will aslo give memtest.bin executable permissions.

Offline

#11 2005-02-17 22:36:02

Abaddon
Member
From: Poland
Registered: 2004-05-03
Posts: 226

Re: problem with building memtest86

Thx, I'll post full pkgbuild on "New and Requested Packages".


Gnome - The weakest link!
Linux, *not* GNU/Linux!

Offline

Board footer

Powered by FluxBB