Re: [fpc-pascal] $LINKLIB MSVCRT on windows/osx
On 03/09/2014 08:36 PM, m...@rpzdesign.com wrote: > Marco: > > Based on the tone of your response, I am thinking that I > am doing something stupid on windows win32? > You are on the correct path but you need to point to the mingw libraries. They provide the stubs for msvcrt and other windows standard libraries. Take a look at these step by step instructions on static linking http://forum.lazarus.freepascal.org/index.php/topic,15712.msg84781.html#msg84781 . It is about linking Sqlite but it applies to most C code. Ludo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
On 10 Mar 2014, at 05:15, m...@rpzdesign.com wrote: > After diving deeply into the dependency tree, > > there are 2 libraries that are involved in this particular problem: > > /usr/lib/libSystem.B.dylib > /usr/lib/libgcc_s.1.dylib > > But I cannot figure out yet how to call up the libgcc_s.1.dylib Since the library is called libgcc_s, use {$linklib gcc_s}. You don't have to (and shouldn't) explicitly link in libSystem, that's already done by the compiler. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Shared memory on various OSes
When a DLL/so is loaded dynamically by multiple program instances, are globals shared or would this require explicit use of OS-level shared memory? The application is emulating a region of scratchpad memory (File Protect Memory) used by hardware in an obsolete computer (Burroughs B5700). This provided the locking that allowed multiple computers to share a common disc system. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared memory on various OSes
On Mon, 10 Mar 2014, Mark Morgan Lloyd wrote: When a DLL/so is loaded dynamically by multiple program instances, are globals shared or would this require explicit use of OS-level shared memory? You'll need explicit use of OS-level shared memory. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Shared memory on various OSes
Michael Van Canneyt wrote: On Mon, 10 Mar 2014, Mark Morgan Lloyd wrote: When a DLL/so is loaded dynamically by multiple program instances, are globals shared or would this require explicit use of OS-level shared memory? You'll need explicit use of OS-level shared memory. Thanks, noted :-) -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC for ARMv4
> On Friday, 7 March 2014, 11:04, Jonas Maebe wrote: > > > On 05 Mar 2014, at 19:41, Jon wrote: > >> I have a board running Linux - it reports itself as armv4tl: >> >> root@phidgetsbc:~# uname -a >> Linux phidgetsbc 3.1.6 #3 PREEMPT Fri Jan 6 13:05:50 MST 2012 >> armv4tl GNU/Linux >> >> root@phidgetsbc:~# cat /etc/issue >> Debian GNU/Linux 6.0 \n \l >> >> >> After trying and failing to install a cross-compiler on my Linux x64 >> system, I want to install FPC directly onto the system. >> >> Can you advise the best procedure. After downloading and installing >> fpc-2.6.2.arm-linux.tar I get errors: > > That compiler is probably built for ARMv6, so it's normal that it > doesn't work on your system. Additionally, you first have to determine > the ABI in use on your system. To do so, run "objdump -p /bin/ls" and > > have a look at the "private flags" section near the end. > > If it contains "EABI", then you have to build an EABI cross-compiler > (compile the ARM compiler with -dFPC_ARMEL in the make OPT parameter), > otherwise you have to build an old ABI cross-compiler (compile the ARM > compiler with no specific parameters in the make OPT parameter, but > add -Cfsoft to CROSSOPT to ensure the created native compiler uses > software floating point). > > > Jonas > If I understand you correctly, I don't use the prebuilt package but instead use the source package (fpc-2.6.2.source.tar.gz) and build it on the unit itself? Do I need binutils or anything else? Cross-compiling has always been very difficult for me, I follow the instructions at http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM but is that the best place? Thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
Peter: I was surprised too. That is why I broadcast the alarm to the FPC community. I am running FPC 2.6.2 - Lazarus 1.0.14 Yes, I can recompile FPC from scratch on Mavericks. I can compile perfectly well on Mavericks too. No, I cannot issue the {$LINKLIB gcc } command on Mavericks OSX 10.9 Have you tried the {$LINKLIB gcc } command? Anybody else got ideas? md On 3/10/2014 1:03 AM, Peter Brooks wrote: I'm a bit surprised. As it happens, just this week I compiled the fpc compiler from scratch on Mavericks. It worked perfectly well, and is compiling perfectly well - version 2.6.0. I was wondering, though, whether there was any enhanced support for features on the Intel 'Sandy-Bridge' and 'Ivy-Bridge' processors - the i5 chips. On 10 March 2014 05:32, m...@rpzdesign.com wrote: Now that OSX Mavericks 10.9 is running full speed, it has broken the {$LINKLIB gcc} compiler directive. {$LINKLIB c} still WORKS. But {$LINKLIB gcc} does not. The reason is that Mavericks does not use GCC any more, it is using clang, a new compiler. So now Freepascal users need to know how to resolve errors: Undefined symbols for architecture i386: "___divdi3", referenced from libmystatic.a, "___moddi3", referenced from libmystatic.a, etc... ANybody got ideas? I tried {$LINKLIB clang}, it does not exist. Thanks for any ideas, Marco ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $LINKLIB MSVCRT on windows
Ludo: I wish the forum.lazarus.freepascal.org website were functional. It is usually not responding most of the time. Can you or anybody just copy the step by step instructions into an email and send it to me directly? I would love to look at the step by step instructions, but that forum has an internet connection problem. Funny, last night, I could look at the site for the first time in days, but this morning, it is not available. Maybe it suffers denial of service attacks? Thanks, md On 3/10/2014 3:15 AM, Ludo Brands wrote: On 03/09/2014 08:36 PM, m...@rpzdesign.com wrote: Marco: Based on the tone of your response, I am thinking that I am doing something stupid on windows win32? You are on the correct path but you need to point to the mingw libraries. They provide the stubs for msvcrt and other windows standard libraries. Take a look at these step by step instructions on static linking http://forum.lazarus.freepascal.org/index.php/topic,15712.msg84781.html#msg84781 . It is about linking Sqlite but it applies to most C code. Ludo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
Why are you wanting to use gcc instead? If I wanted to do this, I'd just replace c with a link to gcc. On 10 March 2014 16:14, m...@rpzdesign.com wrote: > Peter: > > I was surprised too. That is why I broadcast the alarm to the FPC > community. > > I am running FPC 2.6.2 - Lazarus 1.0.14 > > Yes, I can recompile FPC from scratch on Mavericks. > I can compile perfectly well on Mavericks too. > > No, I cannot issue the {$LINKLIB gcc } command on Mavericks OSX 10.9 > > Have you tried the {$LINKLIB gcc } command? > > Anybody else got ideas? > > md > > > On 3/10/2014 1:03 AM, Peter Brooks wrote: >> >> I'm a bit surprised. As it happens, just this week I compiled the fpc >> compiler from scratch on Mavericks. It worked perfectly well, and is >> compiling perfectly well - version 2.6.0. >> >> I was wondering, though, whether there was any enhanced support for >> features on the Intel 'Sandy-Bridge' and 'Ivy-Bridge' processors - the >> i5 chips. >> >> On 10 March 2014 05:32, m...@rpzdesign.com wrote: >>> >>> Now that OSX Mavericks 10.9 is running full speed, it has broken the >>> {$LINKLIB gcc} compiler directive. >>> >>> {$LINKLIB c} still WORKS. >>> But {$LINKLIB gcc} does not. >>> >>> The reason is that Mavericks does not use GCC any more, it is using >>> clang, >>> a new compiler. >>> >>> So now Freepascal users need to know how to resolve errors: >>> >>> Undefined symbols for architecture i386: >>> "___divdi3", referenced from libmystatic.a, >>> "___moddi3", referenced from libmystatic.a, etc... >>> >>> ANybody got ideas? >>> >>> I tried {$LINKLIB clang}, it does not exist. >>> >>> Thanks for any ideas, >>> >>> Marco >>> >>> >>> >>> >>> >>> >>> ___ >>> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >> >> ___ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >> > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
Jonas, Unfortunately, your suggestion while appreciated does not work. For example, the actual function "__divdi3" actually lives in /usr/lib/system/libcompiler_rt.dylib This library does not exist on Snow Leopard. But it does exist on Mavericks. (I do not have Lion/Mtn Lion available) {$LINKLIB gcc_s} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB compiler_rt} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB /usr/lib/system/libcompiler_rt.dylib} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB /usr/lib/libgcc_s.1.dylib} does not work -> Library NOT found by FPC compiler/linker I also tried using: {$LIBRARYPATH /usr/lib/system} {$LINKLIB compiler_rt} So this is more challenging that I originally thought. Must I go back to Mountain Lion to do OSX development with FPC/Lazarus? The mystery still continues... On 3/10/2014 3:18 AM, Jonas Maebe wrote: On 10 Mar 2014, at 05:15, m...@rpzdesign.com wrote: After diving deeply into the dependency tree, there are 2 libraries that are involved in this particular problem: /usr/lib/libSystem.B.dylib /usr/lib/libgcc_s.1.dylib But I cannot figure out yet how to call up the libgcc_s.1.dylib Since the library is called libgcc_s, use {$linklib gcc_s}. You don't have to (and shouldn't) explicitly link in libSystem, that's already done by the compiler. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
Peter: I must use some form of {$LINKLIB gcc} {$LINKLIB c} still WORKS under OSX 10.9 {$LINKLIB gcc} does not work user OSX 10.9 Mavericks. "__divdi3" unresolved reference lives in the gcc run time library chain. md On 3/10/2014 11:21 AM, Peter Brooks wrote: Why are you wanting to use gcc instead? If I wanted to do this, I'd just replace c with a link to gcc. On 10 March 2014 16:14, m...@rpzdesign.com wrote: Peter: I was surprised too. That is why I broadcast the alarm to the FPC community. I am running FPC 2.6.2 - Lazarus 1.0.14 Yes, I can recompile FPC from scratch on Mavericks. I can compile perfectly well on Mavericks too. No, I cannot issue the {$LINKLIB gcc } command on Mavericks OSX 10.9 Have you tried the {$LINKLIB gcc } command? Anybody else got ideas? md On 3/10/2014 1:03 AM, Peter Brooks wrote: I'm a bit surprised. As it happens, just this week I compiled the fpc compiler from scratch on Mavericks. It worked perfectly well, and is compiling perfectly well - version 2.6.0. I was wondering, though, whether there was any enhanced support for features on the Intel 'Sandy-Bridge' and 'Ivy-Bridge' processors - the i5 chips. On 10 March 2014 05:32, m...@rpzdesign.com wrote: Now that OSX Mavericks 10.9 is running full speed, it has broken the {$LINKLIB gcc} compiler directive. {$LINKLIB c} still WORKS. But {$LINKLIB gcc} does not. The reason is that Mavericks does not use GCC any more, it is using clang, a new compiler. So now Freepascal users need to know how to resolve errors: Undefined symbols for architecture i386: "___divdi3", referenced from libmystatic.a, "___moddi3", referenced from libmystatic.a, etc... ANybody got ideas? I tried {$LINKLIB clang}, it does not exist. Thanks for any ideas, Marco ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $LINKLIB MSVCRT on windows
On 3/10/2014 7:23 AM, m...@rpzdesign.com wrote: Ludo: I wish the forum.lazarus.freepascal.org website were functional. It is usually not responding most of the time. Must be an issue on your side, I can access it, at any time I have tried in the last few weeks, just perfectly fine... Ralf --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
On 10 Mar 2014, at 19:07, m...@rpzdesign.com wrote: Unfortunately, your suggestion while appreciated does not work. For example, the actual function "__divdi3" actually lives in /usr/lib/system/libcompiler_rt.dylib This library does not exist on Snow Leopard. But it does exist on Mavericks. (I do not have Lion/Mtn Lion available) It's the equivalent of libgcc for LLVM. {$LINKLIB gcc_s} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB compiler_rt} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB /usr/lib/system/libcompiler_rt.dylib} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB /usr/lib/libgcc_s.1.dylib} does not work -> Library NOT found by FPC compiler/linker I also tried using: {$LIBRARYPATH /usr/lib/system} {$LINKLIB compiler_rt} I've looked into it. In short: * make sure you are using FPC 2.6.2 or later. * do *not* add any linklib statement * use the compiler command line parameter -WM10.6 (if you want to target minimally Mac OS X 10.6) ... -WM10.9 (if you want to target OS X 10.9) In long: In 10.6 and later those symbols are part of the system library (libSystem, which is the same as libc). That means that if you target 10.6 or later, you don't need to explicitly link against libgcc anymore. However, the linker will only get those symbols from libc/libSystem if you target 10.6 or later, because it knows that they are not available on OS versions. Npw, FPC's default Mac OS X target for Intel is either 10.4 (for i386) or 10.5 (for x86-64). You did not have problems when compiling under 10.6, because a) under that OS version, gcc was still installed as part of the developer tools b) this copy of gcc came with a statically linkable version of libgcc (/usr/lib/gcc/powerpc-apple-darwin10/VERSION/libgcc.a) c) FPC's installer asks gcc for the path to this libgcc.a and adds a library search path for it to the default config file As a result, adding {$linklib gcc} worked to resolve the symbols. It doesn't work under 10.9, because there is no global gcc installation anymore, and hence no accompanying libgcc.a anywhere. Now, since Mac OS X 10.4 you can also dynamically link to libgcc instead of statically (the libgcc_s file). Under 10.4 and 10.5, this file still contained the helpers. That's why you have the following files in /usr/lib: lrwxr-xr-x 1 root wheel 17 Oct 22 22:20 /usr/lib/libgcc_s.1.dylib@ -> libSystem.B.dylib -rwxr-xr-x 1 root wheel 30984 Oct 23 21:09 /usr/lib/libgcc_s.10.5.dylib* lrwxr-xr-x 1 root wheel 19 Oct 23 21:09 /usr/lib/libgcc_s.10.4.dylib@ -> libgcc_s.10.5.dylib The latter two are compatibility files for programs that were previously compiled with Mac OS X 10.4 or 10.5 as target. On those systems (and in those SDKs), libgcc_s.dylib was a symbolic link to libgcc_s.10.4.dylib resp. libgcc_s.10.5.dylib). As a result, programs compiled against those SDKs and linking to libgcc_s.dylib, would record libgcc_s.10.4.dylib resp. libgcc_s.10.5.dylib as the real library name in the binary, and will still work even though there's no libgcc_s.dylib anymore. This means that you can still explicitly link your programs against them by adding {$linklib gcc_s.10.5} to your program. Unless you still want to support 10.5 or 10.4, using -WM10.6 or higher is probably better though (this parameter tells the compiler/linker that you targeting Mac OS X 10.6 and later, and hence the required symbols will be taken from libSystem). Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
Jonas: Where in Lazarus 1.0.14 do I put in the compiler command line option? -WM10.9 Project Options->Compiler Options->Compilation->Compiler->Command-> $(CompPath) -WM10.9 And when I use this setting -WM10.9, this means that I can only execute the resulting binary on Mavericks and above? But if I use -WM10.6, then this means that I am targeting for Snow Leopard 10.6 and above? Thank you for breaking this down today. Cheers, md On 3/10/2014 3:46 PM, Jonas Maebe wrote: On 10 Mar 2014, at 19:07, m...@rpzdesign.com wrote: Unfortunately, your suggestion while appreciated does not work. For example, the actual function "__divdi3" actually lives in /usr/lib/system/libcompiler_rt.dylib This library does not exist on Snow Leopard. But it does exist on Mavericks. (I do not have Lion/Mtn Lion available) It's the equivalent of libgcc for LLVM. {$LINKLIB gcc_s} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB compiler_rt} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB /usr/lib/system/libcompiler_rt.dylib} does not work -> Library NOT found by FPC compiler/linker {$LINKLIB /usr/lib/libgcc_s.1.dylib} does not work -> Library NOT found by FPC compiler/linker I also tried using: {$LIBRARYPATH /usr/lib/system} {$LINKLIB compiler_rt} I've looked into it. In short: * make sure you are using FPC 2.6.2 or later. * do *not* add any linklib statement * use the compiler command line parameter -WM10.6 (if you want to target minimally Mac OS X 10.6) ... -WM10.9 (if you want to target OS X 10.9) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Freepascal on OSX 10.9 Mavericks $LINKLIB gcc broken
On Mon, 10 Mar 2014 20:18:38 -0400 "m...@rpzdesign.com" wrote: > Jonas: > > Where in Lazarus 1.0.14 do I put in the compiler command line option? > -WM10.9 > > Project Options->Compiler Options->Compilation->Compiler->Command No, that's the path to the compiler, no extra options. > -WM10.9 Extra options are called "custom options": Project Options->Compiler Options->Compilation->Other->Custom options > And when I use this setting -WM10.9, this means that I can only execute > the resulting binary on Mavericks and above? Yes. > But if I use -WM10.6, then this means that I am targeting for Snow > Leopard 10.6 and above? Yes. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] $LINKLIB MSVCRT on windows
I'm getting 404 error some times (randomly). However, in a minute I can access the forum again. It might be an issue on the hosting server. thanks, Dmitry On Mon, Mar 10, 2014 at 3:21 PM, Ralf Quint wrote: > On 3/10/2014 7:23 AM, m...@rpzdesign.com wrote: > >> Ludo: >> >> I wish the forum.lazarus.freepascal.org website were functional. It is >> usually not responding most of the time. >> >> Must be an issue on your side, I can access it, at any time I have tried > in the last few weeks, just perfectly fine... > > Ralf > > --- > This email is free from viruses and malware because avast! Antivirus > protection is active. > http://www.avast.com > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal