d2sqlite3 icon indicating copy to clipboard operation
d2sqlite3 copied to clipboard

Linking error

Open jamesragray opened this issue 3 years ago • 2 comments

When using the all-included option on Ubuntu 21.10 with gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2) got the following linking error: Linking... /usr/bin/ld.gold: error: /home/gavin/.dub/packages/d2sqlite3-1.0.0/d2sqlite3/sqlite3.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC collect2: error: ld returned 1 exit status Error: /usr/bin/cc failed with status: 1 /home/gavin/dlang/ldc-1.27.1/bin/ldc2 failed with exit code 1.

Was able to build by adding the suggested flag in sqlite.mak:

CC?= /usr/bin/cc all: sqlite3.o

sqlite3.o: c/sqlite3.c $(CC) -c -O2 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_UNLOCK_NOTIFY -fPIC c/sqlite3.c

clean: rm -f *.o

jamesragray avatar Nov 17 '21 08:11 jamesragray

Any reason to use all-included over with-lib ? I think the latter is mixing concerns and prone to issues, so I have been tempted to deprecate it for a while.

Geod24 avatar Nov 17 '21 09:11 Geod24

The reason we went for that option is that we thought that the bindings were designed to work with a specific version of sqlite, and this was a convenient way to make sure we were using the correct version.

jamesragray avatar Nov 17 '21 09:11 jamesragray