View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014733CMakeCMakepublic2014-02-04 09:542016-06-10 14:31
Reportervalentin 
Assigned ToKitware Robot 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformAppleOSOSXOS Version10.6
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0014733: [OSX] Specify arch-specific flags with multiple CMAKE_OSX_ARCHITECTURES
DescriptionHi all !

First of all, I apologize for my bad english ;)
I'm trying to use LuaJIT (built as a fat-binaries) on OSX with my application. The problem is that the doc says I have to add some flags ("-pagezero_size 10000 -image_base 100000000") with a 64bit build to not get a segfault, and on the other hand, it won't compile with the 32bit one ("ld: section __mach_header would make the output executable exceed available address range for architecture i386")

Since I'm configuring the "fat-build" with the CMAKE_OSX_ARCHITECTURES="i386;x86_64" option, can you consider to add an option to specify a flag with the x86_64 build only, and not use it with the i386 ?

Thanks you for reading :)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035036)
Brad King (manager)
2014-02-04 10:36

Interesting use case. I do not think we have any way to specify arch-specific flags. CMAKE_OSX_ARCHITECTURES is special to support OS X universal binaries so we don't have a first-class notion of multiple architectures in a single build tree.
(0035037)
Brad King (manager)
2014-02-04 11:04

For the Makefile and Ninja generators we generate only one compile line and specify multiple "-arch" flags so it is not possible to specify separate flags for that case without significant refactoring of the generators.

For the Xcode generator there is already a feature you can use to get these flags for a target. See the target property XCODE_ATTRIBUTE_<an-attribute>:

 http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:XCODE_ATTRIBUTE_an-attribute [^]

For example:

 set_property(TARGET myexe PROPERTY
   "XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64]" "-pagezero_size 10000 -image_base 100000000"
   )

This isn't a first-class feature but at least you could use it to build.
(0042476)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-02-04 09:54 valentin New Issue
2014-02-04 10:36 Brad King Note Added: 0035036
2014-02-04 10:36 Brad King Severity minor => feature
2014-02-04 10:36 Brad King Status new => backlog
2014-02-04 10:36 Brad King Summary [OSX] Specify 64bit-specific flag with CMAKE_OSX_ARCHITECTURES => [OSX] Specify arch-specific flags with multiple CMAKE_OSX_ARCHITECTURES
2014-02-04 11:04 Brad King Note Added: 0035037
2016-06-10 14:29 Kitware Robot Note Added: 0042476
2016-06-10 14:29 Kitware Robot Status backlog => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team