Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-21
09:59 • Closed ticket [fed5069f8a]: NetBSD: support LDFLAGS plus 4 other changes artifact: 341bdab60c user: serhiy.storchaka
2020-02-12
16:12 • Closed ticket [f20bee173b]: configure script using tclconfig doesn't honor L... artifact: d4247656de user: jan.nijtmans
15:35 • Ticket [f20bee173b]: 3 changes artifact: cdbe3d9b1e user: stephanm
2020-02-11
11:22 • Pending ticket [f20bee173b]. artifact: a879c1700d user: jan.nijtmans
2020-02-05
09:56 • Ticket [f20bee173b]: 4 changes artifact: be1d3b828a user: jan.nijtmans
2020-02-04
18:27 • Add attachment ldflags.diff to ticket [f20bee173b] artifact: 05bf5770e0 user: stephanm
18:25 • Ticket [f20bee173b] configure script using tclconfig doesn't honor LDFLAGS o... artifact: a69fcb4943 user: stephanm
13:43 • Ticket [f20bee173b]: 3 changes artifact: 79056782ed user: stephanm
2020-02-02
16:23 • Ticket [f20bee173b]: 3 changes artifact: 9b55e4a311 user: jan.nijtmans
2020-01-31
18:34 • New ticket [f20bee173b]. artifact: 5bcfc85067 user: stephanm

configure script using tclconfig doesn't honor LDFLAGS on configure run

Closed / Fixedf20bee173b6698084299a75d68f2aa384e68e78cCreated 7 years agoUpdated 7 years ago
Descriptionplain2020-01-31 18:34:01
While running configure, the final linking step fails because additional linker flags from LDFLAGS are ignored. This seems to be introduced by commit 99966fe (tclconfig github mirror, Jan 6 2020 by  jan.nijtmans). This effectively breaks cross-compilation in my case. I'm using ubuntu disco but this shouldn't really matter.
Thank you for any information!
Referenced by1
  • 341bdab60cClosed ticket [fed5069f8a]: NetBSD: support LDFLAGS plus 4 other changes ticket2026-10-21 09:59:44
jan.nijtmanswiki2020-02-02 16:23:56

Apparently, you are referring to fossil commit [68a2eea8733390e6].

So how can the addition of $LDFLAGS cause that LDFLAGS is ignored???

I'm not able to reproduce this, not knowing which Makefile you are using, which version of Tcl, which extension you are compiling, which environment (host and cross). So, please, add more information here to help me.

My guess is that your Makefile lacks $LDFLAGS somewhere

stephanmplain2020-02-04 13:43:56
Sorry, it could easily be an error on my side as I am not that familiar with tclconfig. And indeed, I got the history wrong, please ignore my last comment about the assumed commit id.

I'm using tcl 8.6.10, cross-built, nothing fancy (./configure --prefix=/tmp/tcl8.6.10 --host=i686-w64-mingw32 && make install). Host is ubuntu disco, target is Windows (32 bit).

Steps to reproduce:
1) Checkout sampleextension, cd into it and checkout tclconfig (both current github master)
2) autoreconf -fi 
3) LDFLAGS="-Ltestpath" ./configure --with-tcl=/tmp/tcl8.6.10/lib --host=i686-w64-mingw32
4) make
5) Linking call is "i686-w64-mingw32-gcc -shared -o sample05.dll sample.o tclsample.o  "/tmp/tcl8.6.10/lib/libtclstub86.a" -static-libgcc ", missing the -Ltestpath parameter.
stephanmplain2020-02-04 18:25:47
After some debugging, I determined that cross-compiling for windows using mingw seems to be the culprit. 
When SHLIB_LD gets set in TEA_CONFIG_CFLAGS, LDFLAGS aren't used as in e.g. the linux case.
So I basically used the linux variant but I had to patch TEA_ENABLE_SYMBOLS to use LDFLAGS for windows + gcc.
Attached is a really small patch that at least fixes my example from above. It would be nice if it could be integrated into tclconfig.
Thanks you!
jan.nijtmansplain2020-02-05 09:56:54
Thanks! Yes, that makes the situation clear, I see the problem now!

I'll have a look at it.
jan.nijtmansplain2020-02-11 11:22:19
This ticket should be fixed now, in
latest tclconfig/thread/sampleextension/tdbc

Please confirm (or not) that it works for you too, so I can close this ticket.
stephanmplain2020-02-12 15:35:51
Thank you, compilation works now with the current (f34df7f998) fossil checkout!
jan.nijtmans Closed ticket [f20bee173b]. [History diff]2020-02-12 16:12:24
Log in (anonymous is fine) to add a comment.