Menu

PB with Xcode under V3.0

guibzh
2007-12-13
2013-04-24
  • guibzh

    guibzh - 2007-12-13

    Hi,
    first thanks a lot for your really useful Framework. I can't understand why it's natively included in the apple framework.
    Anyway, i used it succesfully on Leopard with Xcode 3 and tried to do the same with Tiger and my Xcode 2.5 and 2.4.1 versions. It results by a compilation error :
    /usr/bin/ld: /Developer/Local/Frameworks/RegexKit.framework/RegexKit unknown flags (type) of section 5 (__TEXT,__dof_RegexKit) in load command 0
    I know that I can use Xcode 3 on tiger but i really need to work with the previous versions of Xcode.
    Thanks for your help.

     
    • John Engelhart

      John Engelhart - 2007-12-14

      I opened a bug to track this: 1850418

      Off the top of my head, I'm not sure what the problem is.  As some of the final steps just before release, I do a clean build of the framework on a 10.4 system, and use the framework that will be in the final distribution (and thus built under 10.5, but should be 10.4 compatible) as a sanity check.  Obviously I didn't run in to any problems during my tests.  The ppc and i386 architectures are built so to target a minimum OS version of 10.4, while the ppc64 and x86_64 architectures are built to target a minimum of 10.5.

      Hmm, do you happen to be building for either ppc64 or x86_64 under 10.4?  I could see that definitely triggering an error message like the one you're seeing.

       
    • Ben

      Ben - 2008-01-21

      I'm having this same issue.  Using XCode 2.5 on 10.4.11.  On difference is that my error is slightly different:

      /Developer/usr/bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: /Developer/Local/Frameworks/RegexKit.framework/RegexKit unknown flags (type) of section 6 (__TEXT,__dof_RegexKit) in load command 0

      The section is question looks lie this in otool

      Section
        sectname __literal4
         segname __TEXT
            addr 0x0002c2c0
            size 0x00000008
          offset 180928
           align 2^2 (4)
          reloff 0
          nreloc 0
           flags 0x00000003
      reserved1 0
      reserved2 0

      This happened as soon as I upgraded to 0.5.  I rebuilt the framework (with the SDK root manually set to 10.4u) and still get the same results.  I'm not compiling for 64bit with this project, however i do cross develop for Leopard.  Any more thoughts?  I can send you a copy of my build config if it would help.

       
    • John Engelhart

      John Engelhart - 2008-01-21

      After some digging around, I found the 'problem'.  BTW, you posted the info for the wrong section (__TEXT,__literal4), not (__TEXT,__dof_RegexKit).

      The problem lies with the __dofRegexKit section, which is new in 10.5.  From the 10.5 mach-o/loader.h:

      #define S_DTRACE_DOF 0xf /* section contains DTrace Object Format */

      This contains the information that enables DTrace functionality.  It would appear that the older 10.4 tools don't know what to do with it.  In hindsight, they should be ignoring it.  This is probably a bug that apple should fix.  That section is ignored when an executable loads the library at run time, the problem lies in the linking phase.  So, if you were to build everything under 10.5, everything would run fine under 10.4.

      After some digging around, I can't find an easy way to strip that information from the library.  None of the common tools (ld, nmedit, strip, etc) seem to include an option for arbitrarily stripping out a given section.

      If you must link with the older tool chain, you can probably do something like the following (I haven't tested this, but it should work)

      Comment out the #define ENABLE_DTRACE_INSTRUMENTATION line in RegexKitDefines.h and remove 'RegexKitProbes.d' from Targets > RegexKit Framework > Compile Sources.  This should remove all references to dtrace functionality.  Rebuild the framework.

      Depending on your needs, you can either use the newly built framework as-is, or you can use it as a 'proxy stub' library. With some degree of convolution, it should be possible to use the newly built framework to link against, but copy the fully functional library (with DTrace support enabled) in to your applications bundle.  The fully functional library will link and run just fine on 10.4 systems, it's just jumping over that linking step that's a problem.

       
    • John Engelhart

      John Engelhart - 2008-01-21

      FYI,

      I have opened bug # 5698078 with apple regarding this issue.  Ideally they will update the XCode 2.5 train of tools to properly link against frameworks that include DTrace functionality.  This would seem like a trivial modification, so hopefully it'll happen.

       
    • Ben

      Ben - 2008-01-22

      Yes, apparently I did attach the wrong section.  I think the issue is that if you run otool -l on this in 10.4 it doesn't actually show the (__TEXT,__dof_RegexKit) section.  So you had said that it'll run on 10.4.x it just won't link correctly when building projects on 10.4.x, right?  Its a great framework.  Much better than trying to interpret google translations of japanese OgreKit docs.

       
    • Ben

      Ben - 2008-01-22

      Sorry, I didn't read your post closely enough. I'll build my release with 0.5 and for the moment use 0.4 while working on Tiger.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.