cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.98k stars 986 forks source link

link error #231

Open stefanhusmann opened 6 years ago

stefanhusmann commented 6 years ago

I try to build chez-scheme' latest commit from git under Arch Linux using the PKGBUILD from AUR. https://aur.archlinux.org/packages/chez-scheme-git

The build fails with a link arror.

ld -melf_x86_64 -r -X -o ../boot/ta6le/kernel.o statics.o segment.o alloc.o symbol.o intern.o gcwrappe r.o gc-ocd.o gc-oce.o number.o schsig.o io.o new-io.o print.o fasl.o stats.o foreign.o prim.o prim5.o flushcache.o schlib.o thread.o expeditor.o scheme.o i3le.o ../zlib/libz.a
gcc -D_FORTIFY_SOURCE=2 -m64 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O 2 -D_REENTRANT -pthread -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-bu ffer-size=4 -rdynamic -o ../bin/ta6le/scheme ../boot/ta6le/kernel.o ../boot/ta6le/main.o -lm -ldl -lnc urses -lpthread -lrt -Wl,-O1,--sort-common,--as-needed,-z,relro
/usr/bin/ld: ../boot/ta6le/kernel.o: undefined reference to symbol 'setupterm' /usr/lib/libtinfo.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: [Makefile:37: ../bin/ta6le/scheme] Error 1 make[1]: [Makefile:20: build] Error 2 make: *** [Makefile:19: build] Error 2

lyu commented 6 years ago

Adding LDFLAGS="-ltinfo" during configuration fixes this issue on my Arch installation.

jaseemabid commented 6 years ago

Can confirm. Needed this patch in the PKGBUILD file.

diff --git a/PKGBUILD b/PKGBUILD
index 7134111..0d2a478 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,7 +24,7 @@ prepare() {
 build() {
   cd "$srcdir/${_archivename}" || exit
   unset CHEZSCHEMELIBDIRS
-  ./configure --installprefix=/usr --temproot=$pkgdir
+  LDFLAGS="-ltinfo" ./configure --installprefix=/usr --temproot=$pkgdir
   make
 }