SourceForge has been redesigned. Learn more.
Close

#184 OSX g++ shared link uses wrong shared-lib suffix

open
cpptasks (103)
5
2006-10-13
2006-10-12
Derek Baum
No

On an Intel MacBook Pro,

<cc name="gcc"
outtype="shared"
outfile="log4cxx"
...>
</cc>

results in:

[cc] g++ -g -prebind -dynamiclib -o liblog4cxx.so ...

when it should be -o liblog4cxx.dylib

I have traced this down to GccProcessor.getMachine()
returning "nomachine" instead of the output of "gcc
-dumpmachine", which on my MBP is "i686-apple-darwin8".

This in turn is because CaptureStreamHandler.run() is
getting IOException: Bad file descriptor when trying to
read the output of the command, which appears to be
because getOutput() is attempting to read the stream
after it has been closed.

I attach a simple patch that solves the problem - it
calls the original getOutput() from stop() and adds a
new getOutput() which returns this value.

Thanks,

Derek

Discussion

  • Derek Baum

    Derek Baum - 2006-10-12

    context diff patch against cpptasks-1.0b4

     
  • Derek Baum

    Derek Baum - 2006-10-13

    Logged In: YES
    user_id=940790

    Alternatively, I've just noticed that GccLinker uses
    AbstractProcessor.isDarwin() - which simply tests the
    os.name system property.

    So GppLinker could use isDarwin() rather than
    GccProcessor.getMachine().

    Derek

     
  • Derek Baum

    Derek Baum - 2006-10-13

    Logged In: YES
    user_id=940790

    Note: this problem only occurs when using g++ as the linker.
    It works as expected with gcc.

    Derek

     
  • Derek Baum

    Derek Baum - 2006-10-13
    • summary: OSX shared link uses wrong shared-lib suffix --> OSX g++ shared link uses wrong shared-lib suffix
     

Log in to post a comment.