Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
danielfone opened this Issue · 19 comments

10 participants

@danielfone

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:
http://pastie.org/private/dijl1n9orc1gmynmg0ywla

@e1senh0rn

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

Here is installation log: http://gist.github.com/1125252

@mkroehnert

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

@stevedekorte

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

@danielfone

I got around the problem by modifying the homebrew formula slightly. https://gist.github.com/1149891

@danielfone danielfone closed this
@mkroehnert

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))
with
#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.

@foreverman

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

@mkroehnert

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

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

EDIT:
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.

@nefarioustim

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?

@stevedekorte

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.

@orchistro

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
        #else
                // in .h 
                #define IO_DECLARE_INLINES
-               #define IOINLINE NS_INLINE
+               #define IOINLINE IO_NS_INLINE
        #endif  
@stevedekorte
Owner

Does this work on OSX 10.7?

@orchistro

@stevedekorte

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

@gatesphere

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

@stevedekorte
Owner

Great - thanks orchistro. Is there a pull request?

@orchistro

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 ;-)

@ccreutzig

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.)

@mkroehnert

@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

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/build.sh will work.

@mistydemeo mistydemeo referenced this issue from a commit in mistydemeo/io
@mistydemeo mistydemeo Fix recursive inline
Fixes #135.
ac6fc8e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.