Skip to content

Remove libc #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --host='i386-elf' ${{matrix.assert}} --enable-freestanding --with-libc CC="$(which i686-linux-gnu-gcc)"
run: ./configure --host='i386-elf' ${{matrix.assert}} --enable-freestanding CC="$(which i686-linux-gnu-gcc)"
- name: make
run: make

Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
/examples/Makefile.in
/fixtures/Makefile.in
/include/Makefile.in
/libc/Makefile.in
/libc/include/Makefile.in
/tests/Makefile.in

###########################################
Expand Down Expand Up @@ -78,8 +76,6 @@
/examples/Makefile
/fixtures/Makefile
/include/Makefile
/libc/Makefile
/libc/include/Makefile
/tests/Makefile

/libkernaux.pc
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Common
* Add your name to [COPYING](/COPYING).
* Don't add your name to `AUTHORS` - it's for maintainers.
* Add copyright notice in the beginning of changed files except the headers.
* If you change the behavior (even just fix a bug) of **libkernaux** (stable) or
[libc](/libc), add a record to [ChangeLog](/ChangeLog).
* If you change the behavior (even just fix a bug), add a record
to [ChangeLog](/ChangeLog).

Prohibitions:

Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2022-12-27 Alex Kotov <kotovalexarian@gmail.com>

* configure.ac: Package "--with[out]-libc" has been removed

2022-12-23 Alex Kotov <kotovalexarian@gmail.com>

libkernaux 0.7.0 released
16 changes: 0 additions & 16 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ EXTRA_DIST = autogen.sh CONTRIBUTING.md sha256sums.txt src/assert.h

SUBDIRS = include

if WITH_LIBC
# FIXME: after "make clean" libc is not rebuiling
SUBDIRS += libc
endif

SUBDIRS += .

if ENABLE_FIXTURES
Expand All @@ -21,9 +16,6 @@ if ENABLE_CHECKS
SUBDIRS += examples tests
endif

libc/libc.la:
$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/libc libc.la

AM_CFLAGS += -DKERNAUX_ACCESS_PRIVATE

lib_LTLIBRARIES = libkernaux.la
Expand All @@ -45,14 +37,6 @@ libkernaux_la_SOURCES = \
src/generic/mutex.c \
src/runtime.c

########
# libc #
########

if WITH_LIBC
libkernaux_la_LIBADD += libc/libc.la
endif

#######
# ARCH #
#######
Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ zero). Work-in-progress APIs can change at any time.
* [Example: vfprintf](/examples/printf_file_va.c)
* [Example: snprintf](/examples/printf_str.c)
* [Example: vsnprintf](/examples/printf_str_va.c)
* libc replacement (*work in progress*)
* [ctype.h](/libc/include/ctype.h)
* [errno.h](/libc/include/errno.h)
* [inttypes.h](/libc/include/inttypes.h)
* [setjmp.h](/libc/include/setjmp.h)
* [stdlib.h](/libc/include/stdlib.h)
* [string.h](/libc/include/string.h)
* [sys/types.h](/libc/include/sys/types.h)
* Architecture-specific code (*work in progress*)
* [Declarations](/include/kernaux/arch/)
* [Functions](/include/kernaux/asm/)
Expand Down Expand Up @@ -143,11 +135,6 @@ stable options.
* `--enable-pkg-config[=PATH]` - install pkg-config files
[PATH='${libdir}/pkgconfig']

#### Packages

* `--with-libc` - provides the replacement for some standard C functions.
Useful in freestanding environment, where no libc is present.

### Default options

#### Features
Expand Down Expand Up @@ -211,6 +198,9 @@ You can test with `make check`.

Create configuration script with `./autogen.sh` (if present).

The library requires some functions from the standard C library.
Use [libclayer](https://github.com/tailix/libclayer).

Let's assume that your target triplet is `i386-elf`. Configure with
[cross-compiler](https://wiki.osdev.org/GCC_Cross-Compiler) in `$PATH` to make
without it in `$PATH`:
Expand All @@ -220,8 +210,8 @@ without it in `$PATH`:
--host='i386-elf' \
--disable-shared \
--enable-freestanding \
--with-libc \
CC="$(which i386-elf-gcc)"
CC="$(which i386-elf-gcc)" \
CFLAGS='-I<path/to/libc/headers>'
```

The variables include `AR`, `AS`, `CC`, `CCAS`, `LD`, `NM`, `OBJDUMP`, `RANLIB`,
Expand Down
20 changes: 0 additions & 20 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ AC_CONFIG_FILES([
fixtures/Makefile
fixtures/multiboot2_bin_examples_gen.c
include/Makefile
libc/Makefile
libc/include/Makefile
include/kernaux/version.h
tests/Makefile
tests/test_multiboot2_header_print.c
Expand Down Expand Up @@ -62,7 +60,6 @@ AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [ena
AC_ARG_ENABLE([checks-cppcheck], AS_HELP_STRING([--enable-checks-cppcheck], [enable cppcheck]))
AC_ARG_ENABLE([checks-pthreads], AS_HELP_STRING([--enable-checks-pthreads], [enable tests that require pthreads]))
AC_ARG_ENABLE([checks-python], AS_HELP_STRING([--enable-checks-python], [enable tests that require Python 3 with YAML and Jinja2]))
AC_ARG_ENABLE([split-libc], AS_HELP_STRING([--enable-split-libc], [split off libc]))

dnl Features (with parameter)
AC_ARG_ENABLE([pkg-config], AS_HELP_STRING([--enable-pkg-config@<:@=PATH@:>@], [install pkg-config files @<:@PATH='${libdir}/pkgconfig'@:>@]))
Expand All @@ -86,9 +83,6 @@ AC_ARG_WITH( [printf], AS_HELP_STRING([--without-printf], [wit
AC_ARG_WITH( [printf-fmt], AS_HELP_STRING([--without-printf-fmt], [without printf format parser]))
AC_ARG_WITH( [units], AS_HELP_STRING([--without-units], [without measurement units utils]))

dnl Packages (disabled by default)
AC_ARG_WITH( [libc], AS_HELP_STRING([--with-libc], [with libc replacement]))



################
Expand Down Expand Up @@ -151,7 +145,6 @@ AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [ena
AS_IF([test "$enable_checks_cppcheck" = yes], [enable_checks_cppcheck=yes], [enable_checks_cppcheck=no])
AS_IF([test "$enable_checks_pthreads" = yes], [enable_checks_pthreads=yes], [enable_checks_pthreads=no])
AS_IF([test "$enable_checks_python" = yes], [enable_checks_python=yes], [enable_checks_python=no])
AS_IF([test "$enable_split_libc" = yes], [enable_split_libc=yes], [enable_split_libc=no])

dnl Features (with parameter)
AS_IF([test "$enable_pkg_config" = yes], [enable_pkg_config='${libdir}/pkgconfig'])
Expand All @@ -176,9 +169,6 @@ AS_IF([test "$with_printf" = no ], [with_printf=no], [wit
AS_IF([test "$with_printf_fmt" = no ], [with_printf_fmt=no], [with_printf_fmt=yes])
AS_IF([test "$with_units" = no ], [with_units=no], [with_units=yes])

dnl Packages (disabled by default)
AS_IF([test "$with_libc" = yes], [with_libc=yes], [with_libc=no])



#############
Expand All @@ -187,8 +177,6 @@ AS_IF([test "$with_libc" = yes], [with_libc=yes], [wit

AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests]))
AS_IF([test "$enable_fixtures" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding fixtures]))
AS_IF([test "$enable_checks" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests]))
AS_IF([test "$enable_fixtures" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with fixtures]))

AS_IF([test "$with_printf" = yes -a "$with_ntoa" = no], AC_MSG_ERROR([package `printf' requires package `ntoa']))
AS_IF([test "$with_printf" = yes -a "$with_printf_fmt" = no], AC_MSG_ERROR([package `printf' requires package `printf-fmt']))
Expand Down Expand Up @@ -220,7 +208,6 @@ AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_PTHREADS], [test "$enable_checks_pthreads" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_PYTHON], [test "$enable_checks_python" = yes])
AM_CONDITIONAL([ENABLE_SPLIT_LIBC], [test "$enable_split_libc" = yes])

dnl Features (with parameter)
AM_CONDITIONAL([ENABLE_PKG_CONFIG], [test ! -z "$enable_pkg_config"])
Expand All @@ -242,9 +229,6 @@ AM_CONDITIONAL([WITH_PRINTF], [test "$with_printf" = yes])
AM_CONDITIONAL([WITH_PRINTF_FMT], [test "$with_printf_fmt" = yes])
AM_CONDITIONAL([WITH_UNITS], [test "$with_units" = yes])

dnl Packages (disabled by default)
AM_CONDITIONAL([WITH_LIBC], [test "$with_libc" = yes])

dnl Packages (virtual)
AM_CONDITIONAL([WITH_ARCH_X86], [test "$with_arch_i386" = yes -o "$with_arch_x86_64" = yes])

Expand Down Expand Up @@ -275,7 +259,6 @@ AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS],
AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])])
AS_IF([test "$enable_checks_pthreads" = yes], [AC_DEFINE([ENABLE_CHECKS_PTHREADS], [1], [enabled tests that require pthreads])])
AS_IF([test "$enable_checks_python" = yes], [AC_DEFINE([ENABLE_CHECKS_PYTHON], [1], [enabled tests that require Python 3 with YAML and Jinja2])])
AS_IF([test "$enable_split_libc" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBC], [1], [split off libc])])

dnl Packages (enabled by default)
AS_IF([test "$with_arch_i386" = yes], [AC_DEFINE([WITH_ARCH_I386], [1], [with architecture i386])])
Expand All @@ -294,9 +277,6 @@ AS_IF([test "$with_printf" = yes], [AC_DEFINE([WITH_PRINTF],
AS_IF([test "$with_printf_fmt" = yes], [AC_DEFINE([WITH_PRINTF_FMT], [1], [with printf format parser])])
AS_IF([test "$with_units", = yes], [AC_DEFINE([WITH_UNITS], [1], [with measurement units utils])])

dnl Packages (disabled by default)
AS_IF([test "$with_libc" = yes], [AC_DEFINE([WITH_LIBC], [1], [with libc replacement])])

dnl Packages (virtual)
AS_IF([test "$with_arch_i386" = yes], [AC_DEFINE([WITH_ARCH_X86], [1], [with architecture x86])])
AS_IF([test "$with_arch_x86_64" = yes], [AC_DEFINE([WITH_ARCH_X86], [1], [with architecture x86])])
Expand Down
30 changes: 0 additions & 30 deletions libc/Makefile.am

This file was deleted.

9 changes: 0 additions & 9 deletions libc/include/Makefile.am

This file was deleted.

20 changes: 0 additions & 20 deletions libc/include/ctype.h

This file was deleted.

16 changes: 0 additions & 16 deletions libc/include/errno.h

This file was deleted.

12 changes: 0 additions & 12 deletions libc/include/inttypes.h

This file was deleted.

26 changes: 0 additions & 26 deletions libc/include/kernaux/libc.h

This file was deleted.

27 changes: 0 additions & 27 deletions libc/include/setjmp.h

This file was deleted.

29 changes: 0 additions & 29 deletions libc/include/stdlib.h

This file was deleted.

Loading