New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocaml does not compile on Leopard #4439
Comments
Comment author: @xavierleroy Thanks for diagnosing the problem and for the proposed patch. I'm in the process of applying the patch to the 3.10 bugfix branch, but I'm running into a problem. On our MacOS 10.4/PPC machine, __DARWIN_UNIX03 is not defined when compiling in 32-bit mode, but is defined in 64-bit mode (gcc -m64). Cf. /usr/include/sys/cdefs.h: #if defined(_APPLE_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOUR (Notice the "defined(LP64)".) Is there a preprocessor symbol other than __DARWIN_UNIX03 that would identify more precisely the change from 10.4 to 10.5? Otherwise, I'm afraid more "configure" magic is needed. |
Comment author: gordonhenriksen See if the attached patch works better on Tiger. |
Comment author: @dbuenzli Applied the second patch after ./configure on a 10.5, PPC G4. Built with fastworld.sh and everything seems to work so far. Best, Daniel |
Comment author: @alainfrisch I've applied the second patch on the HEAD branch. This is mainly to test the natdynlink branch on various machines, and might go away (Xavier will decide). |
Comment author: @xavierleroy Sorry for not documenting my changes in this PR. Inspired by a Web search, I commited a fix in the 3.10 release branch that uses #ifdef _STRUCT_PPC_EXCEPTION_STATE and #ifdef _STRUCT_X86_EXCEPTION_STATE to discriminate between 10.4 and 10.5. It seems to work fine under 10.4, and we'll have 10.5 installs to test it in a couple of days. Stay tuned. |
Comment author: @alainfrisch Oops, sorry, I did not check the release310 branch. Xavier's works on 10.5 if one replaces _STRUCT_X86_EXCEPTION_STATE with _STRUCT_X86_EXCEPTION_STATE32. |
Comment author: gordonhenriksen On Leopard, release310 shows... ppc32: okay gcc -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_i386 -DSYS_macosx -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o signals_asm.o signals_asm.c What's wrong with comparison of MAC_OS_X_VERSION_MIN_REQUIRED to check the OS version? |
Comment author: @alainfrisch Gordon: did you try with the modification I suggest (_STRUCT_X86_EXCEPTION_STATE -> _STRUCT_X86_EXCEPTION_STATE32)? |
Comment author: @xavierleroy
Sorry for the typo. Fixed in 3.10 branch.
Probably nothing. It's just that I found the documentation comments for these macros in <AvailabilityMacros.h> somewhat unclear on whether they can reliably be used to determine the version of the development environment (as opposed to controlling the versions of the execution environment for the program being compiled). |
Comment author: gordonhenriksen In this case, I'm pretty sure that detecting the development setenv MACOSX_DEPLOYMENT_TARGET 10.4 actually engages a lot of |
Comment author: @xavierleroy My patch didn't quite work with "setenv MACOSX_DEPLOYMENT_TARGET 10.4", |
Original bug ID: 4439
Reporter: gordonhenriksen
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2007-12-04T08:25:37Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4433
Monitored by: n8gray @alainfrisch
Bug description
As reported on caml-list, compilation aborts here:
gcc -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_i386 -DSYS_macosx -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o signals_asm.o signals_asm.c
signals_asm.c: In function ‘segv_handler’:
signals_asm.c:193: error: dereferencing pointer to incomplete type
signals_asm.c:193: error: dereferencing pointer to incomplete type
signals_asm.c: In function ‘caml_init_signals’:
signals_asm.c:241: error: storage size of ‘stk’ isn’t known
signals_asm.c:241: warning: unused variable ‘stk’
Additional information
These errors are related to Unix'03 compliance; as of Leopard, many nonstandard symbols have been moved out of the user namespace.
struct signaltstack should be referred to as stack_t. If this breaks other platforms, guard the changes to signals_asm.c with #if __DARWIN_UNIX03.
For the other errors, the attached patch fixes the compilation errors by dropping support for Puma (10.1), which is fairly reasonable at this date.
There are still runtime errors on ppc64, but those are present without this patch. Using MACOSX_DEPLOYMENT_TARGET avoids them. I haven't tested x64.
File attachments
The text was updated successfully, but these errors were encountered: