Skip to content

Develop fix r8b mingw #1499

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

Merged
merged 3 commits into from
Sep 3, 2012

Conversation

falcon4ever
Copy link
Contributor

This is an update ( #1484 ) since the merge (208f3bc) broke the windows compatibility.

  1. Updated the OF libs makefile
  2. Added the missing if statement for mingw
  3. Changed the compiler to use 4.6 since the examples are build using 4.6 as well
  4. Reverted the "-fuse-ld=gold" hack
    This hack causes the examples not to build on windows. As stated in the NDK release docs its only for Mac/Linux:

( http://developer.android.com/tools/sdk/ndk/index.html )
Support for the gold linker is only available for ARM and x86 architectures on Linux and Mac OS hosts. This support is disabled by default. Add LOCAL_LDLIBS += -fuse-ld=gold in Android.mk to enable it.

Since a fix will be released in the next NDK (see the reply of this google engineer -> http://code.google.com/p/android/issues/detail?id=35209#c14 ) I would suggest putting "-fuse-ld=gold" in a temporary if statement so it will only append it to LDFLAGS if you're building on the Mac/Linux platform.

For example like:
ifneq ($(shell uname),MINGW32_NT-6.1)
LDFLAGS += -fuse-ld=gold
endif

- Added missing elif statement for mingw
- Changed the compiler from 4.4.3 to 4.6
… to build on Windows.

NDK docs state:
Support for the gold linker is only available for ARM and x86 architectures on Linux and Mac OS hosts.
This support is disabled by default. Add LOCAL_LDLIBS += -fuse-ld=gold in Android.mk to enable it.
@arturoc
Copy link
Member

arturoc commented Aug 21, 2012

mmh, for me it wasn't compiling unless i used gold, i was getting some errors with the linker phase. can you make that conditional for windows?

@falcon4ever
Copy link
Contributor Author

That hack is required when building the project on Mac/Linux. But since the next NDK release will probably not require it, I thought that just reverting the hack and adding a small code snippet would be easier (which can/should be removed in future). It should be placed just after the last ifeq catch (line 70) and it will only append if the platform isn't Windows.

The alternative would be adding either 4 small ifeq statements for every line that has "-fuse-ld=gold" in it or one big ifeq statement that covers all the 4 statements.

Let me know what you would suggest

@arturoc
Copy link
Member

arturoc commented Aug 21, 2012

apart from been necessary on linux and mac the gold linker is way faster than the normal one. i think the simplest is to add a linker flag conditionally for windows only, in Makefile.android after line 33:

 LDFLAGS = --sysroot=$(SYSROOT) -nostdlib -L"$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(GCC_VERSION)/libs/$(ABI)"

i would add something like:

ifneq WINDOWS
   LDFLAGS += -fuse-ld=gold

@inspirit
Copy link
Contributor

well i think that u should also add cygwin detection here since lots of people using it and now make files cant detect it and set correct PLATFORM

@arturoc
Copy link
Member

arturoc commented Sep 3, 2012

sorry it took so long!

arturoc added a commit that referenced this pull request Sep 3, 2012
@arturoc arturoc merged commit a21e5e5 into openframeworks:develop Sep 3, 2012
@noyanc
Copy link
Contributor

noyanc commented Nov 18, 2013

Hey dear Falcon4ever,

-no offence just criticism for further works-

When you prepare a Windows+Eclipse+ADT+NDK compatible setup of the Openframeworks; it should be compatible with ndk-build+cygwin rather then mingw, shouldn't it?

@falcon4ever
Copy link
Contributor Author

@noyanc I personally don't use Cygwin so I won't be patching and testing it for that platform.

Of course you could patch it yourself by downloading a stable 0.7.x branch and looking for this in the makefile:

else ifeq ($(findstring MINGW32,$(shell uname)),MINGW32)
HOST_PLATFORM = windows

and adding this line:

else ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
HOST_PLATFORM = windows

With the release of 0.8.0, I believe the Makefiles have changed quite a bit. A lot of things are now shared between the platforms. I haven't had the chance to see if it still works with MinGw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants