make install fails on OS X with 'recursive inlining' #135

danielfone opened this Issue Aug 4, 2011 · 19 comments


None yet

10 participants


When installing Io on OS X Snow Leopard, either via homebrew or manually, make install fails with:

stevedekorte-io-f63d7fb/libs/iovm/source/IoObject_inline.h: In function ‘IoCoroutine_rawRunTarget’:
stevedekorte-io-f63d7fb/libs/iovm/source/IoObject_inline.h:322: error: ‘always_inline’ function could not be inlined in call to ‘IoObject_rawGetSlot_’: recursive inlining
stevedekorte-io-f63d7fb/libs/iovm/source/IoObject_inline.h:344: error: called from here

Full console dump here:


Installation failed for me too. But I used brew and HEAD io version.

Here is installation log:


On OS X 10.5.8 current HEAD (f63d7fb) also fails to build with gcc-4.0.1


Can you guys upgrade to Lion? I'm afraid we might not have enough contributors to keep supporting old OS versions.


I got around the problem by modifying the homebrew formula slightly.

@danielfone danielfone closed this Aug 16, 2011

Hmm, reverting to an old revision is not a great choice for me. And updating to Lion is currently also not possible.

What worked for me was to replace
#define NS_INLINE static __inline__ __attribute__((always_inline))
#define NS_INLINE static inline
like @jeremytregunna suggested on IRC.

I also had to rename NS_INLINE to IO_NS_INLINE because the compiler complained about a redefinition of the macro while compiling the ObjC bridge.


Hey mkroehnert,
What do you mean by 'rename NS_INLINE to IO_NS_INLINE'?


Instead of
#define NS_INLINE ...
#define IO_NS_INLINE ...

But apparently this part of the problem went away.
I will have to recheck this at home this evening.

If I am using NS_INLINE on OS X 10.5.8 I am getting the following errors compiling the ObjcBridge:

Io/libs/basekit/source/Common_inline.h:56:1: warning: "NS_INLINE" redefined In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12, from Io/addons/ObjcBridge/source/Io2Objc.m:5:

The error goes away when using any other name which is not NS_INLINE or any other previously defined name.


I'm also seeing this issue and don't want to have to revert the version of Io in the brew formula or upgrade to Lion (although it appears the issue still exists with Lion).

Any chance we can get the suggested IO_NS_INLINE patch incorporated into the repo used by brew?


If someone can find the appropriate set of defines which makes it compile properly on both 10.6 and 10.7, I'd be happy accept a patch for this.


I'm using OS X 10.6.8 and I have the same problem.
For me, applying both solutions that mkroehnert had to suggest works:

orchistro.deltabellun:~/sources/io$ git diff
diff --git a/libs/basekit/source/Common_inline.h b/libs/basekit/source/Common_inline.h
index d204193..b574819 100755
--- a/libs/basekit/source/Common_inline.h
+++ b/libs/basekit/source/Common_inline.h
@@ -52,16 +52,17 @@ Kudos to Daniel A. Koepke

 #if defined(__APPLE__) 

-       #define NS_INLINE static __inline__ __attribute__((always_inline))
+       /* #define NS_INLINE static __inline__ __attribute__((always_inline)) */
+       #define IO_NS_INLINE static inline

        #ifdef IO_IN_C_FILE
                // in .c 
                #define IO_DECLARE_INLINES
-               #define IOINLINE NS_INLINE
+               #define IOINLINE IO_NS_INLINE
                // in .h 
                #define IO_DECLARE_INLINES
-               #define IOINLINE NS_INLINE
+               #define IOINLINE IO_NS_INLINE

Does this work on OSX 10.7?



Yes, it does work on OS X 10.7, though it also worked fine for 10.7 without applying the patch.


Nice! This will be helpful going forward with the iobin project, as I had to fix these issues myself when compiling for 10.5.


Great - thanks orchistro. Is there a pull request?


No, I didn't make any push. I needed the patch just for my personal use.
Anyway, you should give credit to @mkroehnert for this ;-)


Just for the benefit of anyone finding this in their google search for the error: I was able to install io 20110905 on 10.6 by using Clang instead of gcc:

brew install --use-clang io

(Incidentally, I also had some /usr/local/lib/libfreetype.* lying around that would break a 64 bit build; simply moving those files aside made the build work. I have no idea what or who put them there.)


@stevedekorte would you like to have a pull request for this patch?
If so, I can create one.
Otherwise I can also just create a gist and attach the url here.

nikhilm commented Apr 17, 2012

I can confirm that this works with clang on Snow Leopard.
If you don't want to use homebrew, setting CC='/usr/bin/clang' before running CMake/ will work.

@mistydemeo mistydemeo added a commit to mistydemeo/io that referenced this issue Jun 6, 2013
@mistydemeo mistydemeo Fix recursive inline
Fixes #135.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment