Russ Cox is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

rsc / plan9port http://swtch.com/plan9port/

Plan 9 from User Space (aka plan9port) is a port of many Plan 9 programs from their native Plan 9 environment to Unix-like operating systems. See the web site http://swtch.com/plan9port/ for details.

Clone this repository (size: 58.2 MB): HTTPS / SSH
hg clone https://bitbucket.org/rsc/plan9port
hg clone ssh://hg@bitbucket.org/rsc/plan9port

Issues

#81 devdraw does not build on OS X Lion / latest Xcode

Reported anonymously

OSX Lion (10.7) fails to compile plan9port (98196ecda9f9 tip).

$ ./INSTALL 
+ Mailing list: http://groups.google.com/group/plan9port-dev
+ Issue tracker: http://code.swtch.com/plan9port/issues/
+ Submitting changes: http://swtch.com/go/codereview
 
* Resetting /tmp/plan9port/config
* Compiler version:
	gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
* Building mk...
>>> cd /tmp/plan9port/src/lib9
9c ctime.c
ctime.c:137: warning: assignment discards qualifiers from pointer target type
ctime.c:141: warning: assignment discards qualifiers from pointer target type
* Building everything (be patient)...
>>> cd /tmp/plan9port/src/lib9; mk all                  
9c  ctime.c
ctime.c:137: warning: assignment discards qualifiers from pointer target type
ctime.c:141: warning: assignment discards qualifiers from pointer target type
>>> cd /tmp/plan9port/src/cmd/devdraw; mk all   
9c -DMULTITOUCH -o osx-screen-carbon-objc.o osx-screen-carbon.m
osx-screen-carbon.m:437: warning: implicit declaration of function ‘InitCursor’
osx-screen-carbon.m:1072: error: ‘OSXCursor’ undeclared
osx-screen-carbon.m:1072: error: expected ‘;’ before ‘oc’
osx-screen-carbon.m:1082: error: ‘oc’ undeclared
osx-screen-carbon.m:1087: warning: implicit declaration of function ‘SetCursor’
mk: 9c -DMULTITOUCH -o ...  : exit status=exit(1)
>>> cd /tmp/plan9port/src/cmd/rc; mk all              
9c  exec.c
exec.c:192: warning: no return statement in function returning non-void
* Installing everything in /tmp/plan9port/bin...
>>> cd /tmp/plan9port/src/cmd; mk install     
9l -o o.bc bc.o 
ld: in /tmp/plan9port/lib/libbio.a, malformed archive TOC entry for _Bwrite, offset 538981428 is beyond end of file 60392
 for architecture i386
collect2: ld returned 1 exit status
mk: 9l -o o.bc ...  : exit status=exit(1)
mk: for i in ...  : exit status=exit(1)
mk: for i in ...  : exit status=exit(1)
$ 
Status: resolved Responsible: nobody Type: bug Priority: major
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 mennis

    written

    That looks like two problems to me.

    1. the carbon include isn't working
    2. libbio got built as 64 bit

    Does that sound right?

  2. #2 mennis

    written

    I think this means everything is built as 32 bit.

    $ FILES=`du -a | grep "\.o$"|cut -f2`
    $ for f in $FILES; do file $f; done | grep "Mach-O object i386" | wc
        1433    5732   63729
    $ for f in $FILES; do file $f; done | grep -v "Mach-O object i386" | wc
           0       0       0
    

    Linker issue?

  3. #3 mennis

    written

    I am able to compile on 10.6.8 and use that copy on 10.7.

  4. #4 Russ Cox

    written

    • Changed status from new to resolved.

    Should be fixed by most recent checkin.

    changeset: 3264:4a4eed621ba4 tag: tip user: Russ Cox <rsc@swtch.com> date: Tue Aug 02 14:28:04 2011 -0400 summary: build: OS X 64-bit build

  5. #5 Russ Cox

    written

    • Changed status from resolved to open.

    Actually, I take it back. The reported errors are fixed but you probably still need to copy $PLAN9/bin/devdraw from an older system.

  6. #6 Russ Cox

    written

    • Changed title from Build broken on OSX Lion to devdraw does not build on OS X Lion / latest Xcode.
  7. #7 mennis

    written , last edited

    Using 3266:1ddb9b093c12 besides carbon issues I get these two errors.

    9l -o o.snarfer osx-snarfer.o -F/System/Library/PrivateFrameworks
    ld: warning: directory not found for option '-L/usr/X11R6/lib64'
    ...
    9l -o o.bc bc.o 
    ld: in /Users/mennis/src/plan9port/lib/lib9.a, malformed archive TOC entry for _utfutf, offset 150304500 is beyond end of file 787644
     for architecture x86_64
    
    india:plan9port mennis$ ls /usr/X11R6/
    bin	include	lib	man	share	var
    
    india:plan9port mennis$ uname -a
    Darwin india.x.com 11.0.0 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64 x86_64
    
    india:plan9port mennis$ gcc -v
    Using built-in specs.
    Target: i686-apple-darwin11
    Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
    Thread model: posix
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
    

    Happy to provide more info if asked.

  8. #8 Anonymous

    written

    ld: in /Users/mennis/src/plan9port/lib/lib9.a, malformed archive TOC entry for _utfutf, offset 150304500 is beyond end of file 787644

    Xcode 4 is screwing the .a files

    [mac:bin]$ cat Darwin/ar

    1. !/bin/sh shift exec libtool -static -o $@

    this works for me... maybe 9ar needs the magic

  9. #9 Anonymous

    written

    anon was fgb... it ate the \n's ...

  10. #10 Anonymous

    written

    I got the same error on a program of mine. It is solved by running ranlib after ar and before ld. The problem is ld not being able to generate the archive TOC on its own.

  11. #11 Russ Cox

    written

    • Changed status from open to resolved.

    With some recent fixes, everything seems fine using Lion and the recently released-to-App-Store Xcode 4.2.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?