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

Fix build for OS X. #8

Closed
cmumford opened this issue Sep 9, 2014 · 11 comments
Closed

Fix build for OS X. #8

cmumford opened this issue Sep 9, 2014 · 11 comments
Assignees

Comments

@cmumford
Copy link
Contributor

cmumford commented Sep 9, 2014

Original issue 2 created by paul.joseph.davis on 2011-05-08T22:17:55.000Z:

LevelDB fails to build on OS X with standard GCC from XCode and so on and such forth.

This patch mixes up the Posix and Chromium port implementations as well as pulls in a couple Chromium headers so that building on OS X is possible without requiring that users build GCC 4.5.

Patch commit is at [1] and attached as a diff.

[1] https://github.com/davisp/leveldb/commit/50e280c9b1cfde0e255d124f38e1aa436d36ba52

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #1 originally posted by tfarina@chromium.org on 2011-05-22T18:07:01.000Z:

<empty>

@cmumford cmumford self-assigned this Sep 9, 2014
@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #2 originally posted by tim%creationix.com@gtempaccount.com on 2011-05-23T21:23:29.000Z:

Would this patch not be better? https://github.com/davisp/leveldb/commit/50e280c9b1cfde0e255d124f38e1aa436d36ba52

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #3 originally posted by paul.joseph.davis on 2011-05-23T21:39:18.000Z:

That's the same patch. I attached it as a diff to prevent link rot.

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #4 originally posted by paul.joseph.davis on 2011-05-23T23:06:02.000Z:

Also, link rot rears its ugly head.

A more permanent link:

https://github.com/davisp/leveldb/compare/master...osx

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #5 originally posted by s@little--eyes.com on 2011-05-25T20:01:07.000Z:

Thanks for sharing this. It seems like I successfully applied the patch using from the leveldb root:
patch -p1 -i leveldb_osx.patch

But I'm getting this error when I call 'make'.

g++ -c -DLEVELDB_PLATFORM_POSIX -I. -I./include -std=c++0x -g2 db/db_bench.cc -o db/db_bench.o
cc1plus: error: unrecognized command line option "-std=c++0x"
make: *** [db/db_bench.o] Error 1

This is with gcc version 4.2.1 (Apple Inc. build 5664)

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #6 originally posted by paul.joseph.davis on 2011-05-25T20:25:25.000Z:

There are a couple lines in the Makefile that you need to change for OS X. The CFLAGS variable needs to change as well as a change to the list of sources. There's comments in the Makefile that are specific to what needs to happen.

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #7 originally posted by stefeo on 2011-05-25T20:47:30.000Z:

Thank you, that worked (I also had to apply your log_test patch [1]).

What is the step following 'make' to actually build the library?

[1] http://code.google.com/p/leveldb/issues/detail?id=6

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #8 originally posted by tfarina@chromium.org on 2011-05-25T20:53:04.000Z:

There is no library code yet on the Makefile. :(

Patches welcome.

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #9 originally posted by stefeo on 2011-05-25T23:54:01.000Z:

Adding this to the Makefile:

library: $(LIBOBJECTS) 
    ar rcs lib-leveldb.a $(LIBOBJECTS)

and calling 'make library' seemed to do the trick.

As a side note, adding -fvisibility=hidden to the CFLAGS seemed to get rid of 33 visibility warnings I was getting.

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #10 originally posted by ashoemaker on 2011-06-06T20:55:23.000Z:

It seems this is fixed as of r29 - make runs without warnings or errors on XCode 3 and 4.

@cmumford
Copy link
Contributor Author

cmumford commented Sep 9, 2014

Comment #11 originally posted by dgrogan@chromium.org on 2011-06-16T09:44:11.000Z:

<empty>

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

1 participant