Tiger, libcc_dynamic, and the new gcc

While trying to install sys-libs/readline (a part of emerge system) on my shiny new Tiger install, it became real clear real quick that Tiger was missing /usr/lib/libcc_dynamic.a, something that Panther provides as a symlink to libgcc.a. Having discussed the matter with Kito, we have decided not to simply provide a symlink mirroring that in Panther. Instead, we’ve settled on modifying any makefiles: s:-lcc_dynamic:-lgcc:.

As an aside, the new gcc (that’s gcc 4.0) bundled with Mac OS X 10.4 has apparently changed the optimization alias -fast such that it no longer works out of the box on the 7450 cpu (that’s the one in all the PowerBooks). My current CFLAGS are: -O3 -fgcse-sm -funroll-loops -fstrict-aliasing -fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -ffast-math -freorder-blocks -freorder-blocks-and-partition -finline-floor -mpowerpc-gpopt -force_cpusubtype_ALL -mcpu=7450 which is basically -fast minus all the G5-specific stuff and a couple of things that obviously break while building dynamic libraries, etc.

9 Responses to “Tiger, libcc_dynamic, and the new gcc”


  • Switching readline’s Makefile to use -lgcc doesn’t seem to work:

    ( cd shlib ; make all )
    rm -f libreadline.4.3.dylib
    /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name /usr/lib/libreadline.4.3.dylib -current_version 4.3 -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so compat.so -lSystem -lncurses -lgcc
    /usr/bin/libtool: can’t locate file for: -lgcc
    /usr/bin/libtool: file: -lgcc is not an object file (not allowed in a library)

    Any idea what the long term answer will be?

  • Now that’s strange. Take a look at the trackbacked post (the trackback right above your comment). The solution, at least for me, was to run Disk Utility’s ‘repair permissions’. I’ll have to look into the -lgcc when I get more time. Please keep me posted on anything you find.

  • hm, you dont have too many cflags ? ;D

  • Well, if I had a G5, I’d be using -fast… That’s even more CFLAGS; appearances can be deceiving.

  • Yup. Fixing permissions fixed it. Thanks!

    Symbolic link ./usr/lib/gcc/darwin/default->3.3 repaired
    Symbolic link ./usr/lib/libcc_dynamic.a->gcc/darwin/default/libgcc.a repaired
    Symbolic link ./usr/lib/libcc_kext.a->gcc/darwin/default/libcc_kext.a repaired
    Symbolic link ./usr/lib/libgcc.a->gcc/darwin/default/libgcc.a repaired
    Symbolic link ./usr/lib/libstdc++.a->gcc/darwin/default/libstdc++.a repaired
    Symbolic link ./usr/lib/libsupc++.a->gcc/darwin/default/libsupc++.a repaired
    Permissions differ on ./usr/share/info/dir, should be -r–r–r– , they are -rw-r–r–

  • The -fast flag defaults to G5 optimisations; however, it’s smart enough not to use non-applicable flags if used in conjunction with “-mtune=G4 -mcpu=G4″ (or “-mtune=G3 -mcpu=G4″ too, I suppose). This is covered in Apple’s GCC release notes (under “Optimisation”) — and has been available since gcc3.3 iirc.

    Hope this saves you a few lines of CFLAG options…

  • Guys, I found your site whilst searching for a way to enable G5 specific options on my IMAC. I come from FreeBSD and am used to setting CFLAGS in /etc/make.conf. Can someone please assist me. I am using Darwin Ports and wish to build all of the ports with -fast option so that I can get the most out of my Imac.

    Thanks guys,
    The Cheat

  • Each package management system is going to have its own way to specify CFLAGS and CXXFLAGS. DarwinPorts uses its own configuration file, which should really not be messed with. A lot of the ports on DarwinPorts break when using non-standard CFLAGS. Having used to work there, I know that the DarwinPorts team is very supportive and helpful; you may want to ask them about non-standard CFLAGS.

Leave a Reply