bugGforth - Bugs: bug #40978, Failed to compile GForth on MACOSX...

 
 

bug #40978: Failed to compile GForth on MACOSX 10.8.5

Submitted by:  None
Submitted on:  Fri 20 Dec 2013 06:43:45 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 21 Dec 2013 06:23:49 PM UTC, comment #2:

Attached the new version of the patch (see file compile-on-macosx-#40987.1.patch). Tested it with tests in unix/pthread.fs. It looks like __thread works on MacOSX 10.8.5.

Alexander Skobelev <ilowry>
Sat 21 Dec 2013 12:02:31 PM UTC, comment #1:

I have compiled it at last by wrapping gforth_[SFRLU]P, and throw-jmp_handler into functions of sort get_gforth_[SFRLU]PP() and get_throw_jmp_handler(). The patch is attached.

Alexander Skobelev <ilowry>
Fri 20 Dec 2013 06:43:45 AM UTC, original submission:

When run configure as:
./configure CC='gcc -v -arch x86_64' --build=x86_64-apple-darwin12.5.0

– libfcc interface failed to be compiled. Exactly, the building process failed for the all files in the lib/gforth/0.7.9_20130821/libcc-named directory.
The error message says (for all TLS variables):
/include/gforth/0.7.9_20130821/libcc.h:50:8: error: thread-local storage is unsupported for the current target
extern __thread Cell *gforth_SP;

Running gcc with -v flag shows that for some reason it runs clag with -triple x86_64-apple10.3.0 instead of x86_64-apple10.8.0.

Than, if to use the following line to run configure:
./configure CC='gcc -v -arch x86_64' --build=x86_64-apple-macosx10.8.0

– a linking stage fails with error message:
ld: illegal thread local variable reference to regular symbol _gforth_SP for architecture x86_64
Here the full otput from make for this case (I've also changed the glibtool script to use "gcc -v -arch x86_64" instead of default "cc"):


glibtool: compile: gcc -v -arch x86_64 -Wimplicit-function-declaration -O2 -pthread -I /Users/sasha/Src/3d-party/gforth.git/include -O -c /Users/sasha/Src/3d-party/gforth.git/lib/gforth/0.7.9_20130821/libcc-named/filestat.c -o /Users/sasha/Src/3d-party/gforth.git/lib/gforth/0.7.9_20130821/libcc-named/filestat.o >/dev/null 2>&1
glibtool: link: gcc -v -arch x86_64 -Wl,-undefined -Wl,dynamic_lookup -o /Users/sasha/Src/3d-party/gforth.git/lib/gforth/0.7.9_20130821/libcc-named/.libs/libgffilestat.0.so -bundle /Users/sasha/Src/3d-party/gforth.git/lib/gforth/0.7.9_20130821/libcc-named/.libs/filestat.o -arch x86_64 -O2 -pthread -pthread
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -bundle -macosx_version_min 10.8.0 -o /Users/sasha/Src/3d-party/gforth.git/lib/gforth/0.7.9_20130821/libcc-named/.libs/libgffilestat.0.so -undefined dynamic_lookup /Users/sasha/Src/3d-party/gforth.git/lib/gforth/0.7.9_20130821/libcc-named/.libs/filestat.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/lib/darwin/libclang_rt.osx.a
ld: illegal thread local variable reference to regular symbol _gforth_SP for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

in file included from OS command line:-1
unix/filestat.fs:49: libtool link failed

>>>end-c-library<<<



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #30056:  compile-on-macosx-#40987.1.patch added by ilowry (10kB - application/octet-stream - New version of compile-on-macosx-#40987.patch. )
file #30054:  compile-on-macosx-#40987.patch added by None (11kB - application/octet-stream - Patch to fix compilation on MacOSX 10.8. It wraps thread local global variables in functions.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ilowry (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 21 Dec 2013 06:21:21 PM UTCilowryAttached File-=>Added compile-on-macosx-#40987.1.patch, #30056
    Sat 21 Dec 2013 11:54:42 AM UTCNoneAttached File-=>Added compile-on-macosx-#40987.patch, #30054

    Back to the top


    Powered by Savane 3.1-cleanup