Re: [fpc-pascal] Problem compiling
In our previous episode, Jonas Maebe said: Free Pascal Compiler version 2.7.1 [2012/05/22] for i386 Anyone have an idea what could be wrong? Building development versions of FPC always has been and always will be guaranteed to work only if you start with the latest *release* version. Indeed. This is btw typically the error you get when compiling the fixes branc with trunk ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling
On 05.08.12 23:46, dhkblas...@zeelandnet.nl wrote: I get: text.inc(199,34) Error: Illegal type conversion: Text to TextRec after updating the compiler sources from SVN. Free Pascal Compiler version 2.7.1 [2012/05/22] for i386 Anyone have an idea what could be wrong? You have to use the latest release version to compile svn-trunk, which is 2.6.0. Nico ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
rMonitor=packed record ... end; rMonitorEx=packed record dwMonitorSize:DWORD; Monitor:rMonitor; end; Are you sure the C record is packed too ? This would mean that all function pointers in rMonitor are not aligned. I'm not shure about that as I'm not that good at C. The packed record works at 32bit -so I thought that should be correct. Is there a difference between 64Bit and 32Bit? Here is the orginal C definition, could someone take a look at this: typedef struct _MONITOR { BOOL (WINAPI *pfnEnumPorts) (LPWSTR pName, DWORD Level, LPBYTE pPorts, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned); BOOL (WINAPI *pfnOpenPort) (LPWSTR pName, PHANDLE pHandle); BOOL (WINAPI *pfnOpenPortEx) (LPWSTR pPortName, LPWSTR pPrinterName, PHANDLE pHandle, struct _MONITOR FAR *pMonitor); BOOL (WINAPI *pfnStartDocPort) (HANDLE hPort, LPWSTR pPrinterName, DWORD JobId, DWORD Level, LPBYTE pDocInfo); BOOL (WINAPI *pfnWritePort) (HANDLE hPort, LPBYTE pBuffer, DWORD cbBuf, LPDWORD pcbWritten); BOOL (WINAPI *pfnReadPort) (HANDLE hPort, LPBYTE pBuffer, DWORD cbBuffer, LPDWORD pcbRead); BOOL (WINAPI *pfnEndDocPort) (HANDLE hPort); BOOL (WINAPI *pfnClosePort) (HANDLE hPort); BOOL (WINAPI *pfnAddPort) (LPWSTR pName, HWND hWnd, LPWSTR pMonitorName); BOOL (WINAPI *pfnAddPortEx) (LPWSTR pName, DWORD Level, LPBYTE lpBuffer, LPWSTR lpMonitorName); BOOL (WINAPI *pfnConfigurePort) (LPWSTR pName, HWND hWnd, LPWSTR pPortName); BOOL (WINAPI *pfnDeletePort) (LPWSTR pName, HWND hWnd, LPWSTR pPortName); BOOL (WINAPI *pfnGetPrinterDataFromPort) (HANDLE hPort, DWORD ControlID, LPWSTR pValueName, LPWSTR lpInBuffer, DWORD cbInBuffer, LPWSTR lpOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbReturned); BOOL (WINAPI *pfnSetPortTimeOuts) (HANDLE hPort, LPCOMMTIMEOUTS lpCTO, DWORD reserved// must be set to 0); BOOL (WINAPI *pfnXcvOpenPort) (LPCWSTR pszObject, ACCESS_MASK GrantedAccess, PHANDLE phXcv); DWORD (WINAPI *pfnXcvDataPort) (HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded); BOOL (WINAPI *pfnXcvClosePort) (HANDLE hXcv); } MONITOR, FAR *LPMONITOR; typedef struct _MONITOREX { DWORD dwMonitorSize; MONITOR Monitor; } MONITOREX, FAR *LPMONITOREX; regards Lukas -- -- software security networks Lukas Gradl fpc#ssn.at Eduard-Bodem-Gasse 5 A - 6020 Innsbruck Tel: +43-512-214040-0 Fax: +43-512-214040-21 -- ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
On 18 Dec 2009, at 13:39, Lukas Gradl wrote: rMonitor=packed record ... end; rMonitorEx=packed record dwMonitorSize:DWORD; Monitor:rMonitor; end; Are you sure the C record is packed too ? This would mean that all function pointers in rMonitor are not aligned. I'm not shure about that as I'm not that good at C. The packed record works at 32bit -so I thought that should be correct. You must never use a packed record for a C record, unless it is declared in C using __attribute__((__packed__)). The fact that it worked in 32 bit was pure coincidence. You also have to add {$packrecords c} to your source file to tell the compiler to lay out records the same way as C compilers to guarantee interoperability. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
Jonas Maebe schrieb: You must never use a packed record for a C record, unless it is declared in C using __attribute__((__packed__)). The fact that it worked in 32 bit was pure coincidence. You also have to add {$packrecords c} to your source file to tell the compiler to lay out records the same way as C compilers to guarantee interoperability. Jonas, Marc, if you ever come near my place feel free to come along for a beer or something... Never heard of the $packrecords switch, but that was it - now it works for 32 and 64 bits... regards Lukas -- -- software security networks Lukas Gradl fpc#ssn.at Eduard-Bodem-Gasse 5 A - 6020 Innsbruck Tel: +43-512-214040-0 Fax: +43-512-214040-21 -- ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
On Fri, 18 Dec 2009 13:39:45 +0100 Lukas Gradl f...@ssn.at wrote: I'm not shure about that as I'm not that good at C. The packed record works at 32bit -so I thought that should be correct. If it works on 32bit it should be correct. Is there a difference between 64Bit and 32Bit? Yes. Some types have different sizes and even the alignment is different for some types. For details look here: http://www.x86-64.org/documentation.html Here is the orginal C definition, could someone take a look at this: I cannot help you directly but I can give you a hint based on my experience with C-headers on 64-bit. First you should check what types these typedefs like DWORD actually are. After that you can use the corresponding type from the ctypes unit of FPC. This is the easiest way I found to make my C-headers work correctly on 64-bit as types defined in this unit have the correct sizes and alignments. For example DWORD is actually unsigned long, AFAIK. This would be culong in the ctypes unit. hope it helps R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
On Fri, 18 Dec 2009 14:58:10 +0100 Reimar Grabowski reimg...@web.de wrote: On Fri, 18 Dec 2009 13:39:45 +0100 Lukas Gradl f...@ssn.at wrote: I'm not shure about that as I'm not that good at C. The packed record works at 32bit -so I thought that should be correct. If it works on 32bit it should be correct. This is wrong. See Joosts mail. Of course the compiler directive he gave is the correct way. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
Hi! I'm having serious troubles compiling a DLL for 64bit Windows. I'm using FPC svn 1 (Ver 2.5.1) on all machines. I tried on WinXP 32bit (works), Vista 64bit (doesn't work), Win7 32Bit (works) and Win7 64bit (doesn't work). The DLL works as a print-monitor, providing a virtual printer port. For the definitions I used the windows-Unit whereever it would work, the missing ones (mainly the Monitor-Structure i ported from MSDN. (http://msdn.microsoft.com/en-us/library/aa506794.aspx) To see the problem copy the resulting dll in your \windows\system32 folder. Then add a registry folder HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\PMon64Test Inside this folder add a string named Driver with a value of PMon64.dll (which has to be the name of the dll in the System32 Folder. Restart the Spooler-Service and try to add a Printer to your system. On Win64 the Spooler Service will produce an Error with the ErrorCode 0x06be, on win32 the normal AddPrinter Dialog will appear. The source attached provides a basic dll, wich will do nothing but write some information to C:\TMP\DEBUG.TXT if that file is existant (so please create it first!) The Source is: Start library PMon64; {$mode Delphi} {$H+} uses Windows, Sysutils; type pMonitor=^rMonitor; TEnumPortsFunc=function(pName:LPWSTR;dwLevel:DWORD;pPorts:LPBYTE; cbBuf:DWORD;pdwNeeded:LPDWORD; pdwReturned:LPDWORD):BOOL;stdcall; TOpenPortFunc=function(pName:LPWSTR;H:PHANDLE):BOOL;stdcall; TOpenPortExFunc=function(pName,pPrinterName:LPWSTR;H:PHANDLE; _Monitor:pMonitor):BOOL;stdcall; TStartDocPortFunc=function(hPort:HANDLE;pPrinterName:LPWSTR; JobID,Level:DWORD; pDocInfo:LPBYTE):BOOL;stdcall; TWritePortFunc=function(hPort:HANDLE;pBuffer:LPBYTE; cbBuf:DWORD;pcbWritten:LPDWORD):BOOL;stdcall; TReadPortFunc=function(hPort:HANDLE;pBuffer:LPBYTE;cbBuf:DWORD; pcbRead:LPDWORD):BOOL;stdcall; TEndDocPortFunc=function(hPort:HANDLE):BOOL;stdcall; TClosePortFunc=function(hPort:HANDLE):BOOL;stdcall; TAddPortFunc=function(pName:LPWSTR;h:HWND; pMonitorName:LPWSTR):BOOL;stdcall; TAddPortExFunc=function(pName:LPWSTR;Level:DWORD;pBuffer:LPBYTE; pMonitorName:LPWSTR):BOOL;stdcall; TConfigurePortFunc=function(pName:LPWSTR;h:HWND; pMonitorName:LPWSTR):BOOL;stdcall; TDeletePortFunc=function(pName:LPWSTR;h:HWND; pMonitorName:LPWSTR):BOOL;stdcall; TGetPrinterDataFromPortFunc=function(hPort:HANDLE;ControlID:DWORD; pValueName,lpInBuffer:LPWSTR; cbInBuffer:DWORD; lpOutBuffer:LPWSTR; cbOutBuffer:DWORD; lpcbReturned:LPDWORD):BOOL;stdcall; TSetPortTimeOutsFunc=function(hPort:HANDLE;lpTCO:pCommTimeouts; reserved:DWORD):BOOL;stdcall; TXcvOpenPortFunc=function(pszObject:LPCWSTR;GrantedAccess:ACCESS_MASK; phXcv:PHANDLE):BOOL;stdcall; TXcvDataPortFunc=function(hXcv:HANDLE;pszDataName:LPCWSTR; pInputData:PBYTE;cbInputData:DWORD; pOutputData:PBYTE;cbOutputData:DWORD; pcbOutputNeeded:PDWORD):DWORD;stdcall; TXcvClosePortFunc=function(hXcv:HANDLE):BOOL;stdcall; rMonitor=packed record pfnEnumPorts: TEnumPortsFunc; pfnOpenPort: TOpenPortFunc; pfnOpenPortEx: TOpenPortExFunc; pfnStartDocPort: TStartDocPortFunc; pfnWritePort: TWritePortFunc; pfnReadPort: TReadPortFunc; pfnEndDocPort: TEndDocPortFunc; pfnClosePort: TClosePortFunc; pfnAddPort: TAddPortFunc; pfnAddPortEx: TAddPortExFunc; pfnConfigurePort: TConfigurePortFunc; pfnDeletePort: TDeletePortFunc; pfnGetPrinterDataFromPort: TGetPrinterDataFromPortFunc; pfnSetPortTimeOuts: TSetPortTimeOutsFunc; pfnXcvOpenPort: TXcvOpenPortFunc; pfnXcvDataPort: TXcvDataPortFunc; pfnXcvClosePort: TXcvClosePortFunc; end; rMonitorEx=packed record dwMonitorSize:DWORD; Monitor:rMonitor; end; pMonitorEx=^rMonitorEx; var Mon:rMonitorEx; procedure DbgSend(Text:String); var f:Textfile; begin if FileExists('C:\TMP\DEBUG.TXT') then begin AssignFile(f,'C:\TMP\DEBUG.TXT'); Append(f); Writeln(f,FormatDateTime('HH:MM:SS',now())+': '+Trim(Text)); CloseFile(f); end; end; function EnumPorts(pName:LPWSTR;dwLevel:DWORD;pPorts:LPBYTE; cbBuf:DWORD;pdwNeeded:LPDWORD; pdwReturned:LPDWORD):BOOL;stdcall; begin DbgSend('EnumPorts'); end; function OpenPort(pName:LPWSTR;H:PHANDLE):BOOL;stdcall; begin DbgSend('OpenPort'); end; function
Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached
Lukas Gradl wrote: Hi! I'm having serious troubles compiling a DLL for 64bit Windows. I'm using FPC svn 1 (Ver 2.5.1) on all machines. I tried on WinXP 32bit (works), Vista 64bit (doesn't work), Win7 32Bit (works) and Win7 64bit (doesn't work). rMonitor=packed record ... end; rMonitorEx=packed record dwMonitorSize:DWORD; Monitor:rMonitor; end; Are you sure the C record is packed too ? This would mean that all function pointers in rMonitor are not aligned. Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Problem compiling an X client
Hello list! I have problems compiling an X client. The compiler says: Free Pascal Compiler version 2.2.0 [2007/08/31] for i386 Copyright (c) 1993-2007 by Florian Klaempfl Target OS: Linux for i386 Compiling pas/xdemo.pas PPU Loading /usr/local/lib/fpc/2.2.0/units/i386-linux/x11/x.ppu Recompiling x, checksum changed for ctypes Fatal: Can't find unit x used by xdemo Fatal: Compilation aborted Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled) Files x and xlib are available as objects (.ppu, .o) only. Any ideas? Am I doing something wrong? Many thanks, Anton. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] problem compiling svn-fpc for arm-linux
Koenraad Lelong schreef: Jonas Maebe schreef: ... /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE ../objpas/sysconst.pp /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE -Fi../objpas/sysutils ../unix/sysutils.pp /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s: Assembler messages: /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s:11815: Error: offset too large -- `sfm f4,1,[r11,#-1152]' /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s:11862: Error: offset too large -- `lfm f4,1,[r11,#-1152]' sysutils.pp(551,20) Error: Error while assembling exitcode 1 sysutils.pp(551,20) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted make[5]: *** [sysutils.ppu] Fout 1 make[5]: Leaving directory `/home/koenraad/fpc-devel/fpc/rtl/linux' make[4]: *** [linux_all] Fout 2 make[4]: Leaving directory `/home/koenraad/fpc-devel/fpc/rtl' make[3]: *** [rtl] Fout 2 make[3]: Leaving directory `/home/koenraad/fpc-devel/fpc/compiler' make[2]: *** [cycle] Fout 2 make[2]: Leaving directory `/home/koenraad/fpc-devel/fpc/compiler' make[1]: *** [compiler_cycle] Fout 2 make[1]: Leaving directory `/home/koenraad/fpc-devel/fpc' make: *** [build-stamp.arm-linux] Fout 2 I'm going to look at this. Regards, Koenraad Lelong. I got past this error by modifying sysstr.inc (see the enclosed diff). I hope it's an acceptable patch. Now I'm having internal error 200203271 when compiling buildgtk2.pp/gtkspinbutton.inc. I'm going to look at that. Regards, Koenraad Lelong. Index: fpc/rtl/objpas/sysutils/sysstr.inc === --- fpc/rtl/objpas/sysutils/sysstr.inc (revision 3121) +++ fpc/rtl/objpas/sysutils/sysstr.inc (working copy) @@ -1917,7 +1917,7 @@ Function FormatFloat(Const format: String; Value: Extended): String; Var - buf : Array[0..1024] of char; + buf : Array[0..1023] of char; Begin Buf[FloatToTextFmt(@Buf[0],Value,Pchar(Format))]:=#0; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] problem compiling svn-fpc for arm-linux
Koenraad Lelong wrote: Koenraad Lelong schreef: Jonas Maebe schreef: ... /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE ../objpas/sysconst.pp /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE -Fi../objpas/sysutils ../unix/sysutils.pp /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s: Assembler messages: /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s:11815: Error: offset too large -- `sfm f4,1,[r11,#-1152]' /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s:11862: Error: offset too large -- `lfm f4,1,[r11,#-1152]' sysutils.pp(551,20) Error: Error while assembling exitcode 1 sysutils.pp(551,20) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted make[5]: *** [sysutils.ppu] Fout 1 make[5]: Leaving directory `/home/koenraad/fpc-devel/fpc/rtl/linux' make[4]: *** [linux_all] Fout 2 make[4]: Leaving directory `/home/koenraad/fpc-devel/fpc/rtl' make[3]: *** [rtl] Fout 2 make[3]: Leaving directory `/home/koenraad/fpc-devel/fpc/compiler' make[2]: *** [cycle] Fout 2 make[2]: Leaving directory `/home/koenraad/fpc-devel/fpc/compiler' make[1]: *** [compiler_cycle] Fout 2 make[1]: Leaving directory `/home/koenraad/fpc-devel/fpc' make: *** [build-stamp.arm-linux] Fout 2 I'm going to look at this. Regards, Koenraad Lelong. I got past this error by modifying sysstr.inc (see the enclosed diff). I hope it's an acceptable patch. No ;) It solves the problem but not the cause :) I'll look into it when I find time ;) Now I'm having internal error 200203271 when compiling buildgtk2.pp/gtkspinbutton.inc. I'm going to look at that. Regards, Koenraad Lelong. Index: fpc/rtl/objpas/sysutils/sysstr.inc === --- fpc/rtl/objpas/sysutils/sysstr.inc(revision 3121) +++ fpc/rtl/objpas/sysutils/sysstr.inc(working copy) @@ -1917,7 +1917,7 @@ Function FormatFloat(Const format: String; Value: Extended): String; Var - buf : Array[0..1024] of char; + buf : Array[0..1023] of char; Begin Buf[FloatToTextFmt(@Buf[0],Value,Pchar(Format))]:=#0; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] problem compiling svn-fpc for arm-linux
On 19 Mar 2006, at 10:07, Koenraad Lelong wrote: This program is buggy - '@' is used as the comment character for ARM, so everything after that is ignored. The assembler therefore sees: .type operatingsystem_result, which is garbage. The GNU assembler targetted for ARM accepts '#' or '%' here, not '@'. /quote Is there anyone who can give a hint where to look to fix this ? Remove tf_needs_symbol_type from system_arm_linux_info in compiler/ systems/i_linux.pas Or alternatively have a look at the output of gcc -S and if it does generate some sort of symbol type information, change compiler/ aggas.pas:590 based on if (target_info.system system_arm_linux) then ... else ... Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] problem compiling svn-fpc for arm-linux
Jonas Maebe schreef: On 19 Mar 2006, at 10:07, Koenraad Lelong wrote: This program is buggy - '@' is used as the comment character for ARM, so everything after that is ignored. The assembler therefore sees: .type operatingsystem_result, which is garbage. The GNU assembler targetted for ARM accepts '#' or '%' here, not '@'. /quote Is there anyone who can give a hint where to look to fix this ? Remove tf_needs_symbol_type from system_arm_linux_info in compiler/ systems/i_linux.pas Or alternatively have a look at the output of gcc -S and if it does generate some sort of symbol type information, change compiler/ aggas.pas:590 based on if (target_info.system system_arm_linux) then ... else ... Jonas Thanks, Enclosed you will find a diff that allows me to get past that error, but I have another one. Actually two, this morning I had an 'internal error', but I (stupidly) did another svn-update and now I'm having an offset too large in sysutils : /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE ../objpas/sysconst.pp /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE -Fi../objpas/sysutils ../unix/sysutils.pp /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s: Assembler messages: /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s:11815: Error: offset too large -- `sfm f4,1,[r11,#-1152]' /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/sysutils.s:11862: Error: offset too large -- `lfm f4,1,[r11,#-1152]' sysutils.pp(551,20) Error: Error while assembling exitcode 1 sysutils.pp(551,20) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted make[5]: *** [sysutils.ppu] Fout 1 make[5]: Leaving directory `/home/koenraad/fpc-devel/fpc/rtl/linux' make[4]: *** [linux_all] Fout 2 make[4]: Leaving directory `/home/koenraad/fpc-devel/fpc/rtl' make[3]: *** [rtl] Fout 2 make[3]: Leaving directory `/home/koenraad/fpc-devel/fpc/compiler' make[2]: *** [cycle] Fout 2 make[2]: Leaving directory `/home/koenraad/fpc-devel/fpc/compiler' make[1]: *** [compiler_cycle] Fout 2 make[1]: Leaving directory `/home/koenraad/fpc-devel/fpc' make: *** [build-stamp.arm-linux] Fout 2 I'm going to look at this. Regards, Koenraad Lelong. Index: fpc/compiler/aggas.pas === --- fpc/compiler/aggas.pas (revision 2969) +++ fpc/compiler/aggas.pas (working copy) @@ -587,7 +587,10 @@ asmwriteln(Tai_datablock(hp).sym.name); end; if (tf_needs_symbol_type in target_info.flags) then - asmwriteln(#9'.type '+Tai_datablock(hp).sym.name+',@object'); +if (target_info.systemsystem_arm_linux) then + asmwriteln(#9'.type '+Tai_datablock(hp).sym.name+',@object') +else + asmwriteln(#9'.type '+Tai_datablock(hp).sym.name+',%object'); if (tf_needs_symbol_size in target_info.flags) and (tai_datablock(hp).size 0) then asmwriteln(#9'.size '+Tai_datablock(hp).sym.name+','+tostr(Tai_datablock(hp).size)); asmwrite(Tai_datablock(hp).sym.name); ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] problem compiling svn-fpc for arm-linux
Peter Vreman schreef: More specific, the error-lines point to the @object construct. Is there any way I can avoid these errors ? I used revision 2898 of fpc. My arm-linux-as is version 2.14. Use the latest binutils 2.16.1 I downloaded and compiled them from http://www.gnuarm.com, then compiled fpc with it, with no success. Tried again from www.gnu.org, same result. Do I have to specify some option ? Regards, Koenraad Lelong. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] problem compiling svn-fpc for arm-linux
Hi, Since a while I'm experiencing problems compiling fpc from svn for arm-linux. When make CPU_TARGET=arm OS_TARGET=linux all arrives at assembling system.pp for arm it gives following errors : /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc -Xr -Ur -Xs -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE -Us -Sg system.pp /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s: Assembler messages: /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51628: Error: unrecognized symbol type /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51636: Error: unrecognized symbol type /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51643: Error: unrecognized symbol type ...(about 40 similar lines) When I look in system.s at those lines they are all similar to : .section .bss .balign 2 .globl operatingsystem_result .type operatingsystem_result,@object .size operatingsystem_result,2 operatingsystem_result: .zero 2 More specific, the error-lines point to the @object construct. Is there any way I can avoid these errors ? I used revision 2898 of fpc. My arm-linux-as is version 2.14. Thanks for any help, Koenraad Lelong. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] problem compiling svn-fpc for arm-linux
More specific, the error-lines point to the @object construct. Is there any way I can avoid these errors ? I used revision 2898 of fpc. My arm-linux-as is version 2.14. Use the latest binutils 2.16.1 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling new compiler
Marco van de Voort wrote: I downloaded both the 2.1 and the 2.0 daily snapshots. When I try to compile either one I get an error : ... I think the error is the linker complaining about cannot find -lc, but I can't find out what is actually wrong. Any pointers ? It can't find libc. Since nearly every linux distro has libc, this probably means some symlink isn't set. (from libc-x.y.z.a.b.so to libc.so or so in /usr/lib or /lib or both) Some distributions only install the symlink when the corresponding -devel package is installed, but that package can be huge, so setting the symlink manually might help This worked but after making links for libm and libdl and installing gcc + gcc-devel I get the following error : make testgdb make[4]: Entering directory `/home/koenraad/fpc/fpc/ide' LibGDB found in /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a make[4]: Leaving directory `/home/koenraad/fpc/fpc/ide' make fpc_all make[4]: Entering directory `/home/koenraad/fpc/fpc/ide' /home/koenraad/fpc/fpc/compiler/ppc386 -Fl/home/koenraad/fpc/fpc/libgdb/linux/i386 -Ur -Xs -OG2p3 -n -Sg -Fu/home/koenraad/fpc/fpc/rtl/units/i386-linux -Fu/home/koenraad/fpc/fpc/fv/units/i386-linux -Fu/home/koenraad/fpc/fpc/packages/base/gdbint/units/i386-linux -Fu/home/koenraad/fpc/fpc/packages/base/regexpr/units/i386-linux -FE. -FUunits/i386-linux -Fl/usr/lib/gcc-lib/i586-suse-linux/3.3.5 -Fl/usr/X11R6/lib/Xaw95 -Fl/usr/X11R6/lib/Xaw3d -Fl/usr/X11R6/lib -Fl/usr/i486-linux/lib -Fl/usr/i486-linux-libc5/lib=libc5 -Fl/usr/i486-linux-libc6/lib=libc6 -Fl/usr/i486-linuxaout/lib -Fl/usr/i386-suse-linux/lib -Fl/usr/local/lib -Fl/usr/openwin/lib -Fl/opt/kde/lib -Fl/opt/kde2/lib -Fl/opt/kde3/lib -Fl/opt/gnome/lib -Fl/opt/gnome2/lib -Flinclude -Fl/etc/ld.so.conf.d/*.conf -di386 -dRELEASE fp.pas /usr/bin/ld: Warning: alignment 4 of symbol `xdb_commands' in /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(main.o) is smaller than 16 in /home/koenraad/fpc/fpc/packages/base/gdbint/units/i386-linux/gdbint.o /usr/bin/ld: Warning: alignment 4 of symbol `dbx_commands' in /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(main.o) is smaller than 16 in /home/koenraad/fpc/fpc/packages/base/gdbint/units/i386-linux/gdbint.o /usr/bin/ld: Warning: alignment 4 of symbol `gdb_sysroot' in /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(main.o) is smaller than 16 in /home/koenraad/fpc/fpc/packages/base/gdbint/units/i386-linux/gdbint.o /usr/bin/ld: Warning: alignment 4 of symbol `watchdog' in /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(maint.o) is smaller than 16 in /home/koenraad/fpc/fpc/packages/base/gdbint/units/i386-linux/gdbint.o /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(maint.o)(.text+0xeb3): In function `maintenance_set_profile_cmd': maint.c: undefined reference to `atexit' /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(tui-interp.o)(.text+0x1e): In function `tui_init': tui-interp.c: undefined reference to `atexit' fp.pas(494,1) Error: Error while linking make[4]: *** [fp] Fout 1 make[4]: Leaving directory `/home/koenraad/fpc/fpc/ide' make[3]: *** [buildfp] Fout 2 make[3]: Leaving directory `/home/koenraad/fpc/fpc/ide' make[2]: *** [gdb] Fout 2 make[2]: Leaving directory `/home/koenraad/fpc/fpc/ide' make[1]: *** [ide_all] Fout 2 make[1]: Leaving directory `/home/koenraad/fpc/fpc' make: *** [build-stamp.i386-linux] Fout 2 [EMAIL PROTECTED]:~/fpc/fpc Can you give more hints ? TIA Koenraad Lelong ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling new compiler
Marco van de Voort wrote: /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(maint.o) is smaller than 16 in /home/koenraad/fpc/fpc/packages/base/gdbint/units/i386-linux/gdbint.o /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(maint.o)(.text+0xeb3): In function `maintenance_set_profile_cmd': maint.c: undefined reference to `atexit' /home/koenraad/fpc/fpc/libgdb/linux/i386/libgdb.a(tui-interp.o)(.text+0x1e): In function `tui_init': tui-interp.c: undefined reference to `atexit' fp.pas(494,1) Error: Error while linking make[4]: *** [fp] Fout 1 Can you give more hints ? Looks like the libgdb.a wasn't build for this system. Manually build libgdb from gdb sources. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Problem compiling new compiler
I downloaded both the 2.1 and the 2.0 daily snapshots. When I try to compile either one I get an error : make[5]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/netdb' make[4]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/netdb' make -C md5 smart make[4]: Entering directory `/home/koenraad/fpc/fpc/packages/base/md5' make all LINKSMART=1 CREATESMART=1 make[5]: Entering directory `/home/koenraad/fpc/fpc/packages/base/md5' /home/koenraad/fpc/fpc/compiler/ppc386 -XX -CX -Ur -Xs -OG2p3 -n -Fu/home/koenraad/fpc/fpc/rtl/units/i386-linux -FE. -FUunits/i386-linux -di386 -dRELEASE md5.pp make[5]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/md5' make[4]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/md5' make -C gdbint smart make[4]: Entering directory `/home/koenraad/fpc/fpc/packages/base/gdbint' make all LINKSMART=1 CREATESMART=1 make[5]: Entering directory `/home/koenraad/fpc/fpc/packages/base/gdbint' /home/koenraad/fpc/fpc/compiler/ppc386 -XX -CX -Ur -Xs -OG2p3 -n -Fu/home/koenraad/fpc/fpc/rtl/units/i386-linux -Fl/home/koenraad/fpc/fpc/libgdb/linux/i386 -Fo/home/koenraad/fpc/fpc/libgdb/linux/i386 -FE. -FUunits/i386-linux -Fl/usr/X11R6/lib/Xaw95 -Fl/usr/X11R6/lib/Xaw3d -Fl/usr/X11R6/lib -Fl/usr/i486-linux/lib -Fl/usr/i486-linux-libc5/lib=libc5 -Fl/usr/i486-linux-libc6/lib=libc6 -Fl/usr/i486-linuxaout/lib -Fl/usr/i386-suse-linux/lib -Fl/usr/local/lib -Fl/usr/openwin/lib -Fl/opt/kde/lib -Fl/opt/kde2/lib -Fl/opt/kde3/lib -Fl/opt/gnome/lib -Fl/opt/gnome2/lib -Flinclude -Fl/etc/ld.so.conf.d/*.conf -di386 -dRELEASE gdbver.pp /usr/bin/ld: cannot find -lc gdbver.pp(96,1) Error: Error while linking make[5]: *** [gdbver] Fout 1 make[5]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/gdbint' make[4]: *** [fpc_smart] Fout 2 make[4]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/gdbint' make[3]: *** [gdbint_smart] Fout 2 make[3]: Leaving directory `/home/koenraad/fpc/fpc/packages/base' make[2]: *** [base_smart] Fout 2 make[2]: Leaving directory `/home/koenraad/fpc/fpc/packages' make[1]: *** [packages_base_smart] Fout 2 make[1]: Leaving directory `/home/koenraad/fpc/fpc' make: *** [build-stamp.i386-linux] Fout 2 I think the error is the linker complaining about cannot find -lc, but I can't find out what is actually wrong. Any pointers ? It can't find libc. Since nearly every linux distro has libc, this probably means some symlink isn't set. (from libc-x.y.z.a.b.so to libc.so or so in /usr/lib or /lib or both) Some distributions only install the symlink when the corresponding -devel package is installed, but that package can be huge, so setting the symlink manually might help ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Problem compiling new compiler
Hi, I downloaded both the 2.1 and the 2.0 daily snapshots. When I try to compile either one I get an error : make[5]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/netdb' make[4]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/netdb' make -C md5 smart make[4]: Entering directory `/home/koenraad/fpc/fpc/packages/base/md5' make all LINKSMART=1 CREATESMART=1 make[5]: Entering directory `/home/koenraad/fpc/fpc/packages/base/md5' /home/koenraad/fpc/fpc/compiler/ppc386 -XX -CX -Ur -Xs -OG2p3 -n -Fu/home/koenraad/fpc/fpc/rtl/units/i386-linux -FE. -FUunits/i386-linux -di386 -dRELEASE md5.pp make[5]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/md5' make[4]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/md5' make -C gdbint smart make[4]: Entering directory `/home/koenraad/fpc/fpc/packages/base/gdbint' make all LINKSMART=1 CREATESMART=1 make[5]: Entering directory `/home/koenraad/fpc/fpc/packages/base/gdbint' /home/koenraad/fpc/fpc/compiler/ppc386 -XX -CX -Ur -Xs -OG2p3 -n -Fu/home/koenraad/fpc/fpc/rtl/units/i386-linux -Fl/home/koenraad/fpc/fpc/libgdb/linux/i386 -Fo/home/koenraad/fpc/fpc/libgdb/linux/i386 -FE. -FUunits/i386-linux -Fl/usr/X11R6/lib/Xaw95 -Fl/usr/X11R6/lib/Xaw3d -Fl/usr/X11R6/lib -Fl/usr/i486-linux/lib -Fl/usr/i486-linux-libc5/lib=libc5 -Fl/usr/i486-linux-libc6/lib=libc6 -Fl/usr/i486-linuxaout/lib -Fl/usr/i386-suse-linux/lib -Fl/usr/local/lib -Fl/usr/openwin/lib -Fl/opt/kde/lib -Fl/opt/kde2/lib -Fl/opt/kde3/lib -Fl/opt/gnome/lib -Fl/opt/gnome2/lib -Flinclude -Fl/etc/ld.so.conf.d/*.conf -di386 -dRELEASE gdbver.pp /usr/bin/ld: cannot find -lc gdbver.pp(96,1) Error: Error while linking make[5]: *** [gdbver] Fout 1 make[5]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/gdbint' make[4]: *** [fpc_smart] Fout 2 make[4]: Leaving directory `/home/koenraad/fpc/fpc/packages/base/gdbint' make[3]: *** [gdbint_smart] Fout 2 make[3]: Leaving directory `/home/koenraad/fpc/fpc/packages/base' make[2]: *** [base_smart] Fout 2 make[2]: Leaving directory `/home/koenraad/fpc/fpc/packages' make[1]: *** [packages_base_smart] Fout 2 make[1]: Leaving directory `/home/koenraad/fpc/fpc' make: *** [build-stamp.i386-linux] Fout 2 I think the error is the linker complaining about cannot find -lc, but I can't find out what is actually wrong. Any pointers ? TIA, Koenraad Lelong. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal