Hi.

I found tcc segfaults when trying to "-run" pthread-based
C script on Debian (sid, i386) platform, but can compile and
generate correct executable. Following is an example of such
script:

  #!/usr/bin/tcc -run -lpthread
  int main() { return 0; }

It does not matter what code you have in a script - it's what
you link that seems to matter. In above case, it's libpthread
that triggers SEGV error (in __pthread_initialize_minimal).

After some investigation, the cause was TLS (Thread Local Storage)
feature enabled in glibc. The problem disappears when I do

  mv /lib/tls /lib/tls.disabled

Is this a known issue? I searched through the list archive with
various related keywords, but was unable to find such a report.

I still have no idea why tcc fails to run script in-place while
it can generate correct executable without "-run" option.
Is there any workaround to this problem, other than disabling TLS?

Thanks in advance.
--
Taisuke Yamada <[EMAIL PROTECTED]>, http://rakugaki.org/
2268 E9A2 D4F9 014E F11D  1DF7 DCA3 83BC 78E5 CD3A

Message to my public address may not be handled in a timely manner.
For a direct contact, please use my private address on my namecard.


_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to