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

Build fails with clang on OSX 10.11 with PostgreSQL 9.5.1 and Python 2.7 #139

Closed
jmealo opened this issue Apr 13, 2016 · 9 comments
Closed

Comments

@jmealo
Copy link

jmealo commented Apr 13, 2016

I get this error when building from source or using the pgxn installer:

clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  -bundle -multiply_defined suppress -Wl,-undefined,dynamic_lookup -o multicorn.so src/errors.o src/python.o src/query.o src/multicorn.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib  -Wl,-dead_strip_dylibs  -undefined dynamic_lookup -bundle_loader /usr/local/Cellar/postgresql/9.5.1/bin/postgres  -bundle_loader /usr/local/Cellar/postgresql/9.5.1/bin/postgres -lpython2.7 -ldl -framework CoreFoundation -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -ldl -framework CoreFoundation  
0  0x10f29497e  __assert_rtn + 144
1  0x10f2fa260  ld::tool::OutputFile::compressedOrdinalForAtom(ld::Atom const*) + 246
2  0x10f2faf29  ld::tool::OutputFile::addDyldInfo(ld::Internal&, ld::Internal::FinalSection*, ld::Atom const*, ld::Fixup*, ld::Fixup*, ld::Fixup*, ld::Atom const*, ld::Atom const*, unsigned long long, unsigned long long) + 2253
3  0x10f2f079a  ld::tool::OutputFile::generateLinkEditInfo(ld::Internal&) + 1278
4  0x10f2ebe56  ld::tool::OutputFile::write(ld::Internal&) + 116
5  0x10f2958fa  main + 1311
A linker snapshot was created at:
    /tmp/multicorn.so-2016-03-13-090505.ld-snapshot
ld: Assertion failed: (0 && "dylib not assigned ordinal"), function compressedOrdinalForAtom, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-264.3.101/src/ld/OutputFile.cpp, line 3552.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [multicorn.so] Error 1

pg_config output:

BINDIR = /usr/local/Cellar/postgresql/9.5.1/bin
DOCDIR = /usr/local/Cellar/postgresql/9.5.1/share/doc/postgresql
HTMLDIR = /usr/local/Cellar/postgresql/9.5.1/share/doc/postgresql
INCLUDEDIR = /usr/local/Cellar/postgresql/9.5.1/include
PKGINCLUDEDIR = /usr/local/Cellar/postgresql/9.5.1/include
INCLUDEDIR-SERVER = /usr/local/Cellar/postgresql/9.5.1/include/server
LIBDIR = /usr/local/lib
PKGLIBDIR = /usr/local/lib/postgresql
LOCALEDIR = /usr/local/Cellar/postgresql/9.5.1/share/locale
MANDIR = /usr/local/Cellar/postgresql/9.5.1/share/man
SHAREDIR = /usr/local/share/postgresql
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--disable-debug' '--prefix=/usr/local/Cellar/postgresql/9.5.1' '--datadir=/usr/local/share/postgresql' '--libdir=/usr/local/lib' '--sysconfdir=/usr/local/etc' '--docdir=/usr/local/Cellar/postgresql/9.5.1/share/doc/postgresql' '--enable-thread-safety' '--with-bonjour' '--with-gssapi' '--with-ldap' '--with-openssl' '--with-pam' '--with-libxml' '--with-libxslt' '--with-perl' '--with-tcl' '--with-tclconfig=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib' '--with-uuid=e2fs' 'CC=clang' 'LDFLAGS=-L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib' 'CPPFLAGS=-I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include'
CC = clang
CPPFLAGS = -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2
CFLAGS_SL = 
LDFLAGS = -L../../../src/common -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm 
VERSION = PostgreSQL 9.5.1
@robconrad
Copy link

+1

@ramanbuttar
Copy link

bump. running into same issue

@rotten
Copy link

rotten commented May 2, 2016

YMMV, however, I went into the makefile and changed the line (93) that said:

ifeq ($(PORTNAME),darwin)
to
ifeq ($(PORTNAME),Darwin)

And then Multicorn built.

@ergo70
Copy link

ergo70 commented Jun 13, 2016

I can confirm that

ifeq ($(PORTNAME),darwin)
to
ifeq ($(PORTNAME),Darwin)

fixes the build.

@jmealo
Copy link
Author

jmealo commented Jun 13, 2016

@ergo70 @rotten: Kudos, great work! Would you like to make a PR or should someone else?

I tested this and the build also worked. I did not thoroughly test Multicorn though.

@ergo70
Copy link

ergo70 commented Jun 14, 2016

I also found that I need to install the multicorn python module with:

sudo ARCHFLAGS="-arch x86_64" python setup.py install

Otherwise clang tries to build a 32 & 64 bit version and that fails, because int128 is not supported for 32 bit targets.

@thoughtchad
Copy link

  1. edit makefile, change darwin to Darwin
  2. make
  3. sudo ARCHFLAGS="-arch x86_64" make install

@niweicumt
Copy link

edit Makefile, line (93), change darwin to Darwin
make
sudo ARCHFLAGS="-arch x86_64" make install

@ghost ghost mentioned this issue Oct 31, 2017
@ghost
Copy link

ghost commented Oct 31, 2017

Please merge #197

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

7 participants