[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] x86_64, musl: generation of mixed C/C++ fails: undefined

From: Steffen Nurpmeso
Subject: [Tinycc-devel] x86_64, musl: generation of mixed C/C++ fails: undefined reference to `__va_start'
Date: Thu, 03 Jan 2019 13:29:18 +0100
User-agent: s-nail v14.9.11-123-g49d1a5c2


Regardless of whether i use the AlpineLinux default tcc package,
or my version with the little path-resistancy patch, i cannot
create a binary from several C files which become compiled with
tcc -static and linked to an -ar chive, and some C++ files:

  clang -Dsu_USECASE_SU -I../../src -I../../include -Wall -pedantic -o .main.o 
-c .main.cc
  tcc -Dsu_USECASE_SU -I../../src -I../../include -static -g -O1 -Wall 
-pedantic -o avopt.o -c avopt.c
  tcc -ar .clib.a avopt.o core-code.o core-errors.o cs-alloc.o cs-ctype.o 
cs-dict.o cs-find.o cs-misc.o cs-toolbox.o cs-tools.o icodec-dec.o icodec-enc.o 
mem-alloc.o mem-bag.o mem-tools.o prime.o utf.o
  clang  -o .main cxx-core.o .main.o .clib.a
  /usr/bin/ld: .clib.a(core-code.o): in function `su_log_write':
  /home/steffen/src/nail.git/src/su/core-code.c:233: undefined reference to 

The reason is of course that this symbol resides in
/usr/lib/tcc/libtcc1.a, but that is unknown to the linker.
That makes me feel quite dumb, i would not know nothing but
-static in order to address that myself (except for -ar checking
unreferenced symbols for this name, i have never looked into ar(1)
but would not think it goes that far)?

|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]