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

Compilation error on mac os mountain lion 10.8.2 #3

Closed
bslima opened this issue Nov 29, 2012 · 5 comments
Closed

Compilation error on mac os mountain lion 10.8.2 #3

bslima opened this issue Nov 29, 2012 · 5 comments

Comments

@bslima
Copy link

bslima commented Nov 29, 2012

Steps:
bslima:$ git clone git@github.com:msgpack/msgpack.git
bslima:$ cd msgpack/cpp/
bslima:$ ./bootstrap
bslima:$ ./configure
bslima$ make
make all-recursive
Making all in src
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -O3 -Wall -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c -o unpack.lo unpack.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -O3 -Wall -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c unpack.c -fno-common -DPIC -o .libs/unpack.o
unpack.c:463: internal compiler error: Bus error: 10
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://developer.apple.com/bugreporter for instructions.
make[2]: *** [unpack.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

@nobu-k
Copy link
Member

nobu-k commented Jan 8, 2013

Sorry for my late response. In my environment, adding an empty function at the end of unpack.c solved the problem. I don't know why it worked, though. Please try to apply following patch:

diff --git a/src/unpack.c b/src/unpack.c
index d66dc56..4e389ee 100644
--- a/src/unpack.c
+++ b/src/unpack.c
@@ -462,3 +462,6 @@ bool msgpack_unpack_next(msgpack_unpacked* result,
        return true;
 }

+static void dummy_function_to_avoid_bus_error()
+{
+}

Using -O0 instead of -O3 also worked. I guess this is a bug of Mac's gcc. I'll try to find a root cause and a better workaround.

@bslima
Copy link
Author

bslima commented Jan 8, 2013

The patch worked. Dont know the root cause yet.

@bisegni
Copy link

bisegni commented Apr 9, 2013

patch still is need why it is not added into the branch? I know that its is a strange behaviour but it is needed

@nobu-k nobu-k closed this as completed in 1f30cc2 Apr 10, 2013
@nobu-k
Copy link
Member

nobu-k commented Apr 10, 2013

@bisegni You're right. This patch is needed by everyone using OS X. Merge the patch.

I didn't merge it because I didn't even know why this patch solved the problem. Please let me know if someone still has a problem.

@AltarBeastiful
Copy link

Issue is still a problem on osx 10.8.3

/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -O3 -Wall  -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c -o unpack.lo unpack.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O3 -Wall -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c unpack.c  -fno-common -DPIC -o .libs/unpack.o
unpack.c:467: warning: 'dummy_function_to_avoid_bus_error' defined but not used
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -O3 -Wall -g -MT unpack.lo -MD -MP -MF .deps/unpack.Tpo -c unpack.c -o unpack.o >/dev/null 2>&1
make[2]: *** [unpack.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Indeed it's solved by replacing -O0 by -O3 in configure

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

4 participants