run4flat / Alien-TinyCCx

A Perl Alien repository to install my fork of TCC with extended symbol table management
2 stars 0 forks source link

OS X support #4

Open plicease opened 7 years ago

plicease commented 7 years ago

The current CPAN version fails on OS X with this error (observed by myself and from the cpantesters matrix):

gcc -o x86_64/tiny_libmaker ../win32/tools/tiny_libmaker.c -Wall -g -O2 -I.. -D_FORTIFY_SOURCE=0 -Wl,-flat_namespace,-undefined,warning  -DTCC_TARGET_X86_64
x86_64/tiny_libmaker rcs ../libtcc1.a x86_64/libtcc1.o x86_64/alloca86_64.o x86_64/alloca86_64-bt.o
Unsupported Elf Class: x86_64/libtcc1.o
make[1]: *** [Makefile:96: ../libtcc1.a] Error 2
make[1]: Leaving directory '/Users/hornenj/.cpan/build/Alien-TinyCCx-0.12-0/src/lib'
make: *** [Makefile:216: libtcc1.a] Error 2
tcc build failed at make at inc/My/Build/Linux.pm line 4

From git, it builds for me, but I get test failures:

https://gist.github.com/plicease/0445fbafce72d4c4a8044ce1b7973f2b

(gistified for its length).

I see a similar error when trying to install C::Blocks after forcing a Alien::TinyCCx install :)

Alien::TinyCC works on OS X for what it is worth. As always, happy to debug and try things as necessary.

run4flat commented 7 years ago

I have excellent news. I finally figured out how to install Mac OSX into a virtual box running on a Linux host. This means I can, at last, do some serious debugging on Mac once again. For posterity, I list the procedure:

  1. Download the virtualbox image offered here and follow the setup instructions up to the command line work: http://saintlad.com/install-macos-sierra-in-virtualbox-on-windows-10/
  2. Save this as a shell script: https://gist.github.com/u8sand/25d44ced3d4d13c13a734ced0102cde2
  3. Modify the EfiGopMode to match your screen resolution. Settings are discussed here: http://www.insanelymac.com/forum/topic/309654-run-vanilla-os-x-el-capitan-sierra-yosemite-or-mavericks-in-virtualbox-5010-on-a-windows-host/page-2
  4. All set. Run the virtual machine, create a user, etc.
run4flat commented 7 years ago

As to the bug, I suspect that once upon a time I modified the makefile for those tests to execute them using tcc -run. I need to update my alien module for what I presume are some breaking changes in the makefile(s). Thanks for bringing this to my attention!

cpansprout commented 6 years ago

C::Blocks is broken in bleadperl (see https://rt.perl.org/Ticket/Display.html?id=132252#txn-1526921).

It would be nice if you could get Alien::TinyCCx working on OS X so that I can debug C::Blocks.