pinkshirt / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

cmake add -mdynamic-no-pic on Mac #158

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. get last source from git 
2. ./prepmac.sh examples buildex -DWITH_SYSTEM_BOOST=on 
-DBoost_ADDITIONAL_VERSION="1.45;1.45.0" -DCMAKE_OSX_ARCHITECTURES=i386 
3. cd buildex; cmake --build .
first time compilation successful, but if you change something in ccmake 
or simply run again "cmake ."
next time compilation fails on linking stage with message:

ld: absolute addressing (perhaps -mdynamic-no-pic) used in ___tcf_0 from 
/Users/nikita/Projects/firebreath/buildex/projects/FBTestPlugin/FireBreath.build
/Debug/FBTestPlugin.build/Objects-normal/i386/Factory.o not allowed in slidable 
image. Use '-read_only_relocs suppress' to enable text relocs     
collect2: ld returned 1 exit status    

What version of your compiler or IDE are you using?
Xcode 3.1.4
Mac OS X 10.5.8
cmake-2.8.0

Please provide any additional information below.
It seems to me that the main difference between projects generated by  cmake 
first time run and second are on Firebreath.xcodeproj/project.pbxproj

explicitFileType = "wrapper.cfbundle"
and
explicitFileType = "compiled.mach-o.executable"
on lines 665 and 810

Original issue reported on code.google.com by bignikita on 1 Mar 2011 at 10:45

GoogleCodeExporter commented 9 years ago
Is it expected cmake behavior, bug in cmake?

Original comment by bignikita on 1 Mar 2011 at 12:47

GoogleCodeExporter commented 9 years ago
explicitFileType = "wrapper.cfbundle" should be what is there. if it isn't, you 
are likely trying to use a the "cmake patch" branch when you should be using 
the normal branch; either that or you aren't running prepmac.sh

This is patched by a python script after generation.

Original comment by taxilian on 2 Mar 2011 at 6:16

GoogleCodeExporter commented 9 years ago

Original comment by richarda...@gmail.com on 2 Mar 2011 at 7:19

GoogleCodeExporter commented 9 years ago
if someone have to rebuild cmake project, don't forget to run code from 
prepmac.sh

if [ -f "${FB_ROOT}/cmake/patch_xcode.py" ]; then                               

        while read target proj                                                                                                                               
        do                                                                                                                                                   
            python "${FB_ROOT}/cmake/patch_xcode.py" -f "$proj" -t "$target"                                                                                 
        done < "$BUILDDIR/xcode_patch_desc.txt"                                                                                                              
    else                                                                                                                                                     
        echo "Could not find patch_xcode at ${FB_ROOT}/cmake/patch_xcode.py!  Project will not work!"                                                        
fi

Original comment by bignikita on 3 Mar 2011 at 5:13