Skip to content
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

<flag value="-stdlib=libstdc++" unless="HXCPP_GCC" /> breaks on Lion #32

Closed
Justinfront opened this issue Mar 21, 2014 · 8 comments
Closed

Comments

@Justinfront
Copy link

please revert or find alternative for change

d0fc29b#diff-15e66de6f57c543a27161a3adbc163ab

Since on Lion for atleast two users it breaks compile, it results in the following compile error.

cc1plus: error: unrecognized command line option "-stdlib=libstdc++"

If I comment out line 15 in mac-toolchain.xml eg:
flag value="-stdlib=libstdc++" unless="HXCPP_GCC"
( see googlecode submitted bug for clarity )

code will now compile this was verified by another user who following my instruction and was able to use the c++ target.

The user with problems suggested we could look at Travis for mac to avoid these regression issues, but the link only seems to have 10.8.

http://docs.travis-ci.com/user/osx-ci-environment/

But maybe we can run over how travis works at wwx and I can do tests on each new hxcpp release if that is possible I have not read up on what exactly Travis is just seem to hear a lot about it.

( just reported on googlecode as well but just realized that repository is probably dead now http://code.google.com/p/hxcpp/issues/detail?id=268 )

@hughsando
Copy link
Member

Is this using LLVM or GCC? Is the solution to magically set HXCPP_GCC, or is it with an old version of llvm?

@Justinfront
Copy link
Author

Another Lion user on IRC reported it was broken, I noticed the -m32 flag so they checked their processor and it was a 64 bit and I asked them to add
-D HXCPP_M64
but it still gave the error so I suggested they try adding
-D GCC_OLD
same error, so they checked out hxcpp 3.0.2 the version I had and that was working from git and their code now worked.
I checked out latest hxcpp and my build failed for the same reason eg:

haxelib run hxcpp Build.xml haxe -DGCC_OLD="1" -DHXCPP_M64="1" -DawdFile="suzanne.awd" -Dhaxe3="1" -Dhaxe_ver="3.1" -Dhxcpp_api_level="310" -DoutPutFile="summary.txt"
g++ -Iinclude -c -fvisibility=hidden -stdlib=libstdc++ -Qunused-arguments -O2 -I/usr/lib/hxlib/hxcpp/3,1,22//include -DHX_MACOS -m64 -Wno-parentheses -Wno-unused-value -Wno-format-extra-args -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=310 -x c++ -frtti ./src/targets/cpp/AwdCpp.cpp -oobj/darwin64//12569131_AwdCpp.o
cc1plus: error: unrecognized command line option "-stdlib=libstdc++"
Called from sys.io.Process::$statics line 1
Called from BuildTool::main line 2080
Called from BuildTool::$init line 916
Called from a C function
Called from BuildTool::new line 1009
Called from BuildTool::buildTarget line 1401
Uncaught exception - Error in building thread
Error: Build failed

They were running xcode 4.4.1 and I was running 4.2.1
So I compared the mac-toolchain.xml files and noticed line 15 was different did not bother to comment out latter occurrences since did not look like they were being used. This one line fixed the compile error.

His terminal reported gcc is
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

Mine is
gcc (MacPorts gcc46 4.6.3_9) 4.6.3
but maybe xcode uses a different one.

I am happy to test something but I am unable to answer your question, the hxml I used for my test is online but don't think that will help.

Best Justin

@Justinfront
Copy link
Author

his pastebin maybe useful http://pastebin.com/EVsEmkaG

@hughsando
Copy link
Member

It looks like you might need HXCPP_GCC too. I guess this should be implied
by GCC_OLD maybe. If you can confirm that adding this HXCPP_GCC define
fixes things, I can look to add it for the GCC_OLD case. You could also
try adding this in your .hxcpp_config file.

On Fri, Mar 21, 2014 at 1:28 PM, Justinfront notifications@github.comwrote:

his pastebin maybe useful http://pastebin.com/EVsEmkaG

Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-38250170
.

@Justinfront
Copy link
Author

Hugh

What exactly does GCC_OLD handle, while I have 32bit processor running 64bit the other user had 64bit processor and Lion is not so old, should features missing on various mac systems not be automatically handled with try code rather than lumped together with an old flag?
I don't understand what I need to change, can you send me the patch file and I will apply it and test.

Best Justin

@Justinfront
Copy link
Author

Added
-D HXCPP_GCC
and code seems to work I did not for terminal c++ need GCC_OLD

@bapuna
Copy link

bapuna commented Oct 19, 2014

I've run into this problem on OSX Lion as well.

To be specific I was attempting to compile the native mac target using Snowkit which was failing with the following error:

cc1plus: error: unrecognized command line option "-stdlib=libstdc++"

It wasn't quite obvious how to fix the problem from the conversation, or at least not for someone like me who is pretty unfamiliar with Haxe. Anyway for the sake of anyone else who may run into a similar issue, here is one possible way you can fix it:

In your home directory you should find a file named .hxcpp_config.xml. You might need to enable visibility of hidden files in order to see it.

Open it up and add the following line somewhere between <section id="vars"> and </section>:

<set name="HXCPP_GCC" value="1" />

So after the change my entire .hxcpp_config.xml file looked like this:

<xml>

    <section id="vars">

        <set name="MAC_USE_CURRENT_SDK" value="1" />
        <set name="HXCPP_GCC" value="1" />
    </section>

</xml>

Compiling worked fine for me after that.

Thanks anyway guys :) I would not have had a clue without this conversation.

@hughsando
Copy link
Member

I think the config provides the solution. Closing this one now.

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

No branches or pull requests

3 participants