bugTiny C Compiler - Bugs: bug #65602, tcc should support compiling...

 
 

bug #65602: tcc should support compiling programs without depending on glibc (or other libc) (Example: use the nolibc library)

Submitter:  Detlef Riekenberg <wine_dev>
Submitted:  Tue 16 Apr 2024 01:07:57 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 16 Apr 2024 01:07:57 PM UTC, original submission:  

A complete C compiler toolchain includes also the C runtime library.
The C runtime library (libc) includes various header files and also the startup code.

###

tcc has startup code and c runtime headers for Windows, but nothing for Linux.

An nice implementation is "nolibc" (by Willy Tarreau),
which can be added to a fixed tcc.

nolibc has startup code for the relevant linux targets supported by tinycc
(i386, x86_64, arm, aarch64, riscv64)
and a libc implementation based on syscalls.
That would make it easy for tcc to create nice static programs on linux,
which are independant of the installed C runtime library on the target system
and the availability of the related development tools on the development machine.
(glibc, musl, uclibc[_ng], diet libc, ...)

nolibc is dual licensed (MIT and LGPL-2.1)
and is now developed as part of the linux kernel.

nolibc source as a single header version (last change: 2021):
http://git.1wt.eu/git/nolibc.git/

nolibc source as a multi-header-version (last change: 2018):
https://github.com/wtarreau/nolibc

newest nolibc source (multi-header) in the linux kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/include/nolibc
mirror: https://github.com/torvalds/linux/tree/master/tools/include/nolibc


nolibc was already mentioned in the tinycc mailing list:
https://lists.nongnu.org/archive/html/tinycc-devel/2022-05/msg00015.html




Detlef Riekenberg <wine_dev>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55945:  nolibc.h added by wine_dev (89KiB - text/x-chdr - nolibc.h (single header version) from 2021)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wine_dev (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-16 wine_dev Attached File- Added nolibc.h, #55945

    Back to the top

    Powered by Savane 3.14-8eb0.
    Corresponding source code