New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
danielfone opened this Issue Aug 4, 2011 · 19 comments

Comments

Projects
None yet
10 participants
@danielfone

danielfone commented Aug 4, 2011

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

This comment has been minimized.

Show comment
Hide comment
@e1senh0rn

e1senh0rn Aug 4, 2011

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

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

e1senh0rn commented Aug 4, 2011

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

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

@mkroehnert

This comment has been minimized.

Show comment
Hide comment
@mkroehnert

mkroehnert Aug 9, 2011

Contributor

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

Contributor

mkroehnert commented Aug 9, 2011

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

@stevedekorte

This comment has been minimized.

Show comment
Hide comment
@stevedekorte

stevedekorte Aug 16, 2011

Member

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

Member

stevedekorte commented Aug 16, 2011

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

@danielfone

This comment has been minimized.

Show comment
Hide comment
@danielfone

danielfone Aug 16, 2011

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

danielfone commented Aug 16, 2011

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

@danielfone danielfone closed this Aug 16, 2011

@mkroehnert

This comment has been minimized.

Show comment
Hide comment
@mkroehnert

mkroehnert Aug 19, 2011

Contributor

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.

Contributor

mkroehnert commented Aug 19, 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))
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

This comment has been minimized.

Show comment
Hide comment
@foreverman

foreverman Aug 23, 2011

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

foreverman commented Aug 23, 2011

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

@mkroehnert

This comment has been minimized.

Show comment
Hide comment
@mkroehnert

mkroehnert Aug 23, 2011

Contributor

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.

Contributor

mkroehnert commented Aug 23, 2011

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.

@e1senh0rn

This comment has been minimized.

Show comment
Hide comment
@nefarioustim

This comment has been minimized.

Show comment
Hide comment
@nefarioustim

nefarioustim Aug 30, 2011

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?

nefarioustim commented Aug 30, 2011

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

This comment has been minimized.

Show comment
Hide comment
@stevedekorte

stevedekorte Nov 16, 2011

Member

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.

Member

stevedekorte commented Nov 16, 2011

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

This comment has been minimized.

Show comment
Hide comment
@orchistro

orchistro Dec 4, 2011

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  

orchistro commented Dec 4, 2011

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

This comment has been minimized.

Show comment
Hide comment
@stevedekorte

stevedekorte Dec 5, 2011

Member

Does this work on OSX 10.7?

Member

stevedekorte commented Dec 5, 2011

Does this work on OSX 10.7?

@orchistro

This comment has been minimized.

Show comment
Hide comment
@orchistro

orchistro Dec 5, 2011

@stevedekorte

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

orchistro commented Dec 5, 2011

@stevedekorte

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

@gatesphere

This comment has been minimized.

Show comment
Hide comment
@gatesphere

gatesphere Dec 6, 2011

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

gatesphere commented Dec 6, 2011

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

This comment has been minimized.

Show comment
Hide comment
@stevedekorte

stevedekorte Dec 6, 2011

Member

Great - thanks orchistro. Is there a pull request?

Member

stevedekorte commented Dec 6, 2011

Great - thanks orchistro. Is there a pull request?

@orchistro

This comment has been minimized.

Show comment
Hide comment
@orchistro

orchistro Dec 6, 2011

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

orchistro commented Dec 6, 2011

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

This comment has been minimized.

Show comment
Hide comment
@ccreutzig

ccreutzig Mar 24, 2012

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

ccreutzig commented Mar 24, 2012

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

This comment has been minimized.

Show comment
Hide comment
@mkroehnert

mkroehnert Apr 14, 2012

Contributor

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

Contributor

mkroehnert commented Apr 14, 2012

@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

This comment has been minimized.

Show comment
Hide comment
@nikhilm

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

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

mistydemeo added a commit to mistydemeo/io that referenced this issue Jun 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment