Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-02

__stkptr

10 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Den Jean

Hi,

with latest fpc 2.1.1 I get:

cat test.pas
program test; begin writeln('test'); end.
ppc386 test
Free Pascal Compiler version 2.1.1 [2006/02/23] for i386 Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Linux for i386
Compiling test.pas
Linking test
/usr/lib/fpc/2.1.1/units/i386-linux/rtl/system.o: In function `SYSTEM_init': system.pp:(.text+0x169e8): undefined reference to `__stkptr' test.pas(1,38) Error: Error while linking

kind regards,

Den Jean

Reply by email

Peter Vreman
to Den Jean
Show quoted text 16 lines
Hi, with latest fpc 2.1.1 I get: cat test.pas program test; begin writeln('test'); end. ppc386 test Free Pascal Compiler version 2.1.1 [2006/02/23] for i386 Copyright (c) 1993-2005 by Florian Klaempfl Target OS: Linux for i386 Compiling test.pas Linking test /usr/lib/fpc/2.1.1/units/i386-linux/rtl/system.o: In function `SYSTEM_init': system.pp:(.text+0x169e8): undefined reference to `__stkptr' test.pas(1,38) Error: Error while linking

Make sure you have updated all files from svn. The __stkptr is defined in the loader files named *ptr*.o

Reply by email

ochnap2
to Peter Vreman

I have the same problem, but with libraries. dlopen() always fails to load them and dlerror() returns: "../test/libtest.so: undefined symbol: __stkptr"

I just updated to the latest svn.

Thanks,
Och

Peter Vreman wrote 25 lines
> Hi, > > with latest fpc 2.1.1 I get: > > cat test.pas > program test; begin writeln('test'); end. > ppc386 test > Free Pascal Compiler version 2.1.1 [2006/02/23] for i386 > Copyright (c) 1993-2005 by Florian Klaempfl > Target OS: Linux for i386 > Compiling test.pas > Linking test > /usr/lib/fpc/2.1.1/units/i386-linux/rtl/system.o: In function > `SYSTEM_init': > system.pp:(.text+0x169e8): undefined reference to `__stkptr' > test.pas(1,38) Error: Error while linking Make sure you have updated all files from svn. The __stkptr is defined in the loader files named *ptr*.o _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

___________________________________________________________ 1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar

Reply by email

Peter Vreman
to Den Jean: fpc]# svn update At revision 2675. ppc386 test.pas Free Pascal Compiler version 2.1.1…
Show quoted text 15 lines
On Friday 24 February 2006 06:14 am, Peter Vreman wrote: > Fixed fpc]# svn update At revision 2675. ppc386 test.pas Free Pascal Compiler version 2.1.1 [2006/02/24] for i386 Copyright (c) 1993-2005 by Florian Klaempfl Target OS: Linux for i386 Compiling test.pas Linking test /usr/lib/fpc/2.1.1/units/i386-linux/rtl/system.o: In function `SYSTEM_init': system.pp:(.text+0x169e8): undefined reference to `__stkptr' test.pas(1,38) Error: Error while linking

Check with objdump if dllprt0.o exports the __stkptr.

Reply by email

Peter Vreman
to Den Jean: objdump -t dllprt0.o | grep stkptr 00000000 g O .bss 00000004 __stkptr so i checked…
Show quoted text 13 lines
On Friday 24 February 2006 06:55 am, Peter Vreman wrote: > Check with objdump if dllprt0.o exports the __stkptr. objdump -t dllprt0.o | grep stkptr 00000000 g O .bss 00000004 __stkptr so i checked further and i found that just doing ln -fs /usr/lib/fpc/2.1.1/ppc386 /usr/bin/ is not enough to switch fpc versions, because the fpc.cfg from fpc-2.0.0-2mdk.i586.rpm contained -Fu/usr/lib/fpc/2.0.0/units/$fpctarget -Fu/usr/lib/fpc/2.0.0/units/$fpctarget/* -Fu/usr/lib/fpc/2.0.0/units/$fpctarget/rtl

Better change it to /usr/lib/fpc/$fpcversion/units/$fpctarget

Reply by email

Den Jean
to Peter Vreman: Make sure you have updated all files from svn. The __stkptr is defined in the loader…
Peter Vreman wrote
Make sure you have updated all files from svn. The __stkptr is defined in the loader files named *ptr*.o

I did
svn update fpc
now I did
rm -fr fpc
svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc cd fpc
make PREFIX=/usr clean
make PREFIX=/usr all
make PREFIX=/usr install
ln -fs /usr/lib/fpc/2.1.1/ppc386 /usr/bin/

svn update gives:
At revision 2674

still same __stkptr problem.

As i have problems with fpc 2.0.2 I compile fpc with 2.0.0

The problems with 2.0.2 are that some calls to libqt4intf fail (exception div by zero) and not with 2.0.0
I still need to trim down a sample program to be able to report the bug, but is ok to compile 2.1.1 with 2.0.0 ?

BTW the dll fails for a call to this
void QPainter_drawLine3(QPainterH handle, int x1, int y1, int x2, int y2) {

	((QPainter *)handle)->drawLine(x1, y1, x2, y2);

}
if i printf the parameters within this dll, they are fine (no reference/value/byteswap problem but something else)

another call fails after a while, something extra on the stack ???

with fpc 2.0.0 everything works fine, even when the programs runs for a longer time.

kind regards,

Den Jean

Reply by email

Den Jean
to Peter Vreman: Fixed
Peter Vreman wrote
Fixed

fpc]# svn update
At revision 2675.

ppc386 test.pas
Free Pascal Compiler version 2.1.1 [2006/02/24] for i386 Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Linux for i386
Compiling test.pas
Linking test
/usr/lib/fpc/2.1.1/units/i386-linux/rtl/system.o: In function `SYSTEM_init': system.pp:(.text+0x169e8): undefined reference to `__stkptr' test.pas(1,38) Error: Error while linking

Reply by email

Den Jean
to Peter Vreman: Check with objdump if dllprt0.o exports the __stkptr.
Peter Vreman wrote
Check with objdump if dllprt0.o exports the __stkptr.

objdump -t dllprt0.o | grep stkptr
00000000 g O .bss 00000004 __stkptr

so i checked further and i found that just doing
ln -fs /usr/lib/fpc/2.1.1/ppc386 /usr/bin/
is not enough to switch fpc versions,
because the fpc.cfg from fpc-2.0.0-2mdk.i586.rpm contained -Fu/usr/lib/fpc/2.0.0/units/$fpctarget
-Fu/usr/lib/fpc/2.0.0/units/$fpctarget/*
-Fu/usr/lib/fpc/2.0.0/units/$fpctarget/rtl

I removed these lines and all ok.
big apologies

But 2.1.1 gives me the same problems as with 2.0.2 The Qt4 binding does not work. They told
me that lazarus requires 2.0.2, so it is a problem that my binding does not work with 2.0.2

So I will upload a demo program that demonstrate the problem

kind regards,

Den Jean

Reply by email

Michael Van Canneyt
to Peter Vreman: Better change it to /usr/lib/fpc/$fpcversion/units/$fpctarget
Peter Vreman wrote 15 lines
> On Friday 24 February 2006 06:55 am, Peter Vreman wrote: >> Check with objdump if dllprt0.o exports the __stkptr. > > objdump -t dllprt0.o | grep stkptr > 00000000 g O .bss 00000004 __stkptr > > so i checked further and i found that just doing > ln -fs /usr/lib/fpc/2.1.1/ppc386 /usr/bin/ > is not enough to switch fpc versions, > because the fpc.cfg from fpc-2.0.0-2mdk.i586.rpm contained > -Fu/usr/lib/fpc/2.0.0/units/$fpctarget > -Fu/usr/lib/fpc/2.0.0/units/$fpctarget/* > -Fu/usr/lib/fpc/2.0.0/units/$fpctarget/rtl Better change it to /usr/lib/fpc/$fpcversion/units/$fpctarget

We should change the installer so it adds this line to the generated config file.

Michael.

Reply by email