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

ld: unknown option: -Bstatic on macOS (fix included!) #6

Open
tseemann opened this issue Aug 5, 2018 · 7 comments
Open

ld: unknown option: -Bstatic on macOS (fix included!) #6

tseemann opened this issue Aug 5, 2018 · 7 comments

Comments

@tseemann
Copy link

tseemann commented Aug 5, 2018

Even with GNU g++, you can't mix static and dyn libs?

c++ -std=c++11 -o skesa skesa.o glb_align.o -Wl,-Bstatic -L /usr/local/opt/boost/lib -lboost_program_options -lboost_iostreams -lboost_regex -lboost_timer -lboost_chrono -lboost_system -Wl,-Bdynamic -lrt -ldl -lm  -lpthread -lz
ld: unknown option: -Bstatic
collect2: error: ld returned 1 exit status

Seems so:
https://stackoverflow.com/questions/8910908/g-linker-does-not-recognize-bstatic

@tseemann tseemann changed the title ld: unknown option: -Bstatic ld: unknown option: -Bstatic on macOS Aug 5, 2018
@tseemann tseemann changed the title ld: unknown option: -Bstatic on macOS ld: unknown option: -Bstatic on macOS (fix included!) Aug 5, 2018
@tseemann
Copy link
Author

tseemann commented Aug 5, 2018

I modified Makefile.nongs to do this:

PLATFORM=$(shell uname -s)

ifeq ($(PLATFORM),Linux)

LIBS = -Wl,-Bstatic $(BOOST_LIB) \
       -lboost_program_options \
       -lboost_iostreams \
       -lboost_regex \
       -lboost_timer \
       -lboost_chrono \
       -lboost_system \
       -Wl,-Bdynamic -lrt -ldl -lm  -lpthread -lz

else

LIBS = $(BOOST_LIB) \
       -lboost_program_options \
       -lboost_iostreams \
       -lboost_regex \
       -lboost_timer \
       -lboost_chrono \
       -lboost_system \
       -ldl -lm -lpthread -lz

endif

@tseemann
Copy link
Author

This is still a bug.

@souvorov
Copy link
Collaborator

Sorry, I forgot about this one. Done.

@souvorov
Copy link
Collaborator

Is there any simple way to include last changes in 2.4.0 release without making a new release?

@tseemann
Copy link
Author

Nope. That's what 2.4.1 is for :-)
Don't worry about it yet, i think there are more problems.
Struggling to build it on MacOS now with newer boost.

@souvorov
Copy link
Collaborator

I can build on Linux with BOOST 1.72 without problems.

@tseemann
Copy link
Author

Yes, Linux is not a problem. MacOS is the problem. On MacOS we need to use clang as we need to link against a clang compiled boost. can't mix gcc and clang there unfortunately.

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

2 participants