I have Mac OS X 10.9.1 Maveric. Pacal programs compile but fail to run:
% cat tst.p program h(output); begin writeln(output,'did'); end.
% tst dyld: no valid entry point Trace/BPT trap
but a previously compiles version does run:
% tst2009 did
http://www.microbizz.nl/gpc.html
There I find:
GNU Pascal 3.4.6u4 installer for Mac OS X 10.6 Intel native and PowerPC cross-compiler15.7 MB)
The file gpc346u4-10.6-Intel.dmg is identical (by diff) with the one I already have installed.
So what's wrong? How do I get it to compile correctly?
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research Gene Regulation and Chromosome Biology Laboratory Molecular Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov http://schneider.ncifcrf.gov/ (current link) http://alum.mit.edu/www/toms (permanent link)
Thomas Schneider wrote:
I have Mac OS X 10.9.1 Maveric. Pacal programs compile but fail to run:
% cat tst.p program h(output); begin writeln(output,'did'); end.
% tst dyld: no valid entry point Trace/BPT trap
I hope to find the find the time to investigate the problem. In the mean time, does it help to compile with an SDK, e.g.
gpc -Wl,-syslibroot,/Developer/SDKs/MacOSX10.x.sdk/ tst.pas
where x is 5, 6, 7 or 8 ?
Regards,
Adriaan van Os
On 31 Jan 2014, at 11:12, Adriaan van Os wrote:
Thomas Schneider wrote:
I have Mac OS X 10.9.1 Maveric. Pacal programs compile but fail to run: % cat tst.p program h(output); begin writeln(output,'did'); end. % tst dyld: no valid entry point Trace/BPT trap
I hope to find the find the time to investigate the problem.
You probably have to apply similar changes as I did in FPC in http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=2578...
The above problem in particular generally stems from compiling with - pg (so that gcrt1.o is linked in) but without passing "-no_new_main" to the linker for 10.8 and later. Search for -no_new_main in http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp (this code/info was previously in the clang file linked from the commit message above)
Jonas
Jonas Maebe wrote:
You probably have to apply similar changes as I did in FPC in http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=2578...
The above problem in particular generally stems from compiling with -pg (so that gcrt1.o is linked in) but without passing "-no_new_main" to the linker for 10.8 and later. Search for -no_new_main in http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp (this code/info was previously in the clang file linked from the commit message above)
Thanks for the info. I had expected something in that direction, but that saves me time finding out the details.
Regards,
Adriaan van Os
Jonas:
You probably have to apply similar changes as I did in FPC in http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&revision=2578...
The above problem in particular generally stems from compiling with -pg (so that gcrt1.o is linked in) but without passing "-no_new_main" to the linker for 10.8 and later. Search for -no_new_main in http://llvm.org/svn/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp (this code/info was previously in the clang file linked from the commit message above)
I have no clue as to what to do. What are the exact steps needed?
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research Gene Regulation and Chromosome Biology Laboratory Molecular Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov http://schneider.ncifcrf.gov/ (current link) http://alum.mit.edu/www/toms (permanent link)
On Fri, Jan 31, 2014 at 11:12:16AM +0100, Adriaan van Os wrote:
Thomas Schneider wrote:
I have Mac OS X 10.9.1 Maveric. Pacal programs compile but fail to run:
% cat tst.p program h(output); begin writeln(output,'did'); end.
% tst dyld: no valid entry point Trace/BPT trap
I hope to find the find the time to investigate the problem.
Thanks!
In the mean time, does it help to compile with an SDK, e.g.
gpc -Wl,-syslibroot,/Developer/SDKs/MacOSX10.x.sdk/ tst.pas
where x is 5, 6, 7 or 8 ?
Nope. It turns out that x - only 4, 5, 6. exist. I tried to upgrade from developer.apple.com/xcode. They say there that Xcode 5.02 has an OS X 10.9 SDK. When I was about to install I was told that there is already a newer Xcode.app. I don't have the 9 SDK at /Developer/SDKs/. Should I install the older version to get the 10.9 SDK?
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research Gene Regulation and Chromosome Biology Laboratory Molecular Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov http://schneider.ncifcrf.gov/ (current link) http://alum.mit.edu/www/toms (permanent link)
Thomas Schneider wrote:
Nope. It turns out that x - only 4, 5, 6. exist. I tried to upgrade from developer.apple.com/xcode. They say there that Xcode 5.02 has an OS X 10.9 SDK. When I was about to install I was told that there is already a newer Xcode.app. I don't have the 9 SDK at /Developer/SDKs/. Should I install the older version to get the 10.9 SDK?
Apple is often distributing misinformation. These are marketing people and they always want you to use the "latest and greatest Xcode". Actually the SDKs are independent of the Xcode distribution. SDKs are copies of part of older versions of the system software. They enable you to link with older versions of system libraries, so that the software will run on older versions of the system software.
So, for example, you can install the 10.5 SDK in /Developer/SDKs/MacOSX10.5.sdk on Mac OS X 10.6, 10.7, 10.8 or 10.9. Or simply copy it from any Xcode distribution into /Developer/SDKs/MacOSX10.5.sdk.
Using a 10.9 SDK only makes sense on a later release of the system software, for which you need a time machine to get it.
Nope. It turns out that x - only 4, 5, 6. exist. I tried to upgrade
"Nope" isn't a very descriptive result. But I will look at the issue myself.
I have no clue as to what to do. What are the exact steps needed?
I will change the compiler.
Regards,
Adriaan van Os
Adriaan:
I will change the compiler.
GREAT!! Thank you! I've got a 10.9 laptop where the problem occurs but have several other computers that I can't move to 10.9 until the compiler is ready so I hope this is an easy change. So I could do tests if you like.
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research Gene Regulation and Chromosome Biology Laboratory Molecular Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov http://schneider.ncifcrf.gov/ (current link) http://alum.mit.edu/www/toms (permanent link)
Thomas,
I will change the compiler.
GREAT!! Thank you! I've got a 10.9 laptop where the problem occurs but have several other computers that I can't move to 10.9 until the compiler is ready so I hope this is an easy change. So I could do tests if you like.
As an intermediate solution, the following works for me on 10.9
adriaan% gp hello.pas -Wl,-macosx_version_min,10.5 adriaan% ./hello Hello, world.
adriaan% gp hello.pas -Wl,-macosx_version_min,10.6 adriaan% ./hello Hello, world.
adriaan% gp hello.pas -Wl,-macosx_version_min,10.7,-no_pie adriaan% ./hello Hello, world.
This doesn't seem to require any of the SDKs, assuming that you previously installed libSystemStubs.
Regards,
Adriaan van Os
Adriaan:
As an intermediate solution, the following works for me on 10.9
adriaan% gp hello.pas -Wl,-macosx_version_min,10.5 adriaan% ./hello Hello, world.
adriaan% gp hello.pas -Wl,-macosx_version_min,10.6 adriaan% ./hello Hello, world.
adriaan% gp hello.pas -Wl,-macosx_version_min,10.7,-no_pie adriaan% ./hello Hello, world.
This doesn't seem to require any of the SDKs, assuming that you previously installed libSystemStubs.
THANK YOU!!!
All three of those work for me, except that I am using 'gpc' instead of 'gp'. (And of course a different program name.)
What's the difference between gp and gpc?
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research Gene Regulation and Chromosome Biology Laboratory Molecular Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov http://schneider.ncifcrf.gov/ (current link) http://alum.mit.edu/www/toms (permanent link)
Thomas, Schneider wrote:
What's the difference between gp and gpc?
This is described in /Developer/Pascal/gp.html.
1 Introduction
GP is a utility to automate the building of Pascal programs using the GPC compiler. It is distributed as part of the GPC project.
etc.
Regards,
Adriaan van Os
Adriaan:
What's the difference between gp and gpc?
This is described in /Developer/Pascal/gp.html.
Ok, thanks.
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research Gene Regulation and Chromosome Biology Laboratory Molecular Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov http://schneider.ncifcrf.gov/ (current link) http://alum.mit.edu/www/toms (permanent link)