Main: configure.ac: Remove feature "pic"

This commit is contained in:
Alex Kotov 2022-06-04 15:45:49 +03:00
parent 7979002a8c
commit eb3766dc09
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
10 changed files with 17 additions and 32 deletions

View File

@ -1,3 +1,7 @@
2022-06-04 Alex Kotov <kotovalexarian@gmail.com>
* configure.ac: Remove feature "pic"
2022-06-03 Alex Kotov <kotovalexarian@gmail.com>
* configure.ac: Option "--with-libc" renamed to "--with-libc-all"

View File

@ -19,13 +19,6 @@ if ENABLE_WERROR
AM_CFLAGS += -Werror
endif
# TODO: only for specific targets
if ENABLE_PIC
AM_CFLAGS += -fpic
else
AM_CFLAGS += -fno-pic
endif
#######
# all #
#######

View File

@ -114,7 +114,6 @@ stable options.
* `--(enable|disable)-bloat` - heavy binary data
* `--(enable|disable)-float` - floating-point arithmetic
* `--(enable|disable)-pic` - generate position-independent code
* `--(enable|disable)-werror` - fail on warning (`CFLAGS+='-Werror'`)
#### Packages
@ -164,12 +163,11 @@ without it in `$PATH`:
```
./configure \
--host='i386-elf' \
--disable-pic \
--with-libc-all \
AR="$(which i386-elf-ar)" \
CC="$(which i386-elf-gcc)" \
RANLIB="$(which i386-elf-ranlib)" \
CFLAGS='-ffreestanding -nostdlib -fno-stack-protector'
CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector'
```
You can see the following messages. It's

View File

@ -14,6 +14,6 @@ export AR="$CROSS-ar"
export CC="$CROSS-gcc"
export RANLIB="$CROSS-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-stack-protector'
export CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector'
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --disable-pic --with-libc-all
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --with-libc-all

View File

@ -14,6 +14,6 @@ export AR="$CROSS-ar"
export CC="$CROSS-gcc"
export RANLIB="$CROSS-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-stack-protector'
export CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector'
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --disable-pic --with-libc-all
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --with-libc-all

View File

@ -14,6 +14,6 @@ export AR="$CROSS-ar"
export CC="$CROSS-gcc"
export RANLIB="$CROSS-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-stack-protector -mabi=sysv -mcmodel=kernel -mno-80387 -mno-red-zone'
export CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector -mabi=sysv -mcmodel=kernel -mno-80387 -mno-red-zone'
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --disable-pic --with-libc-all
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --with-libc-all

View File

@ -14,6 +14,6 @@ export AR="$TARGET-ar"
export CC="$TARGET-gcc"
export RANLIB="$TARGET-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-stack-protector'
export CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector'
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --disable-pic --with-libc-all
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --with-libc-all

View File

@ -14,6 +14,6 @@ export AR="$TARGET-ar"
export CC="$TARGET-gcc"
export RANLIB="$TARGET-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-stack-protector'
export CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector'
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --disable-pic --with-libc-all
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --with-libc-all

View File

@ -14,6 +14,6 @@ export AR="$TARGET-ar"
export CC="$TARGET-gcc"
export RANLIB="$TARGET-ranlib"
export CFLAGS='-ffreestanding -nostdlib -fno-stack-protector -mabi=sysv -mcmodel=kernel -mno-80387 -mno-red-zone'
export CFLAGS='-fno-pic -ffreestanding -nostdlib -fno-stack-protector -mabi=sysv -mcmodel=kernel -mno-80387 -mno-red-zone'
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --disable-pic --with-libc-all
"$REPO/configure" --host="$HOST" --prefix="$PREFIX" --with-libc-all

View File

@ -20,7 +20,6 @@ AC_CANONICAL_HOST
dnl Features (enabled by default)
AC_ARG_ENABLE([bloat], AS_HELP_STRING([--disable-bloat], [disable unnecessary heavy binary data]))
AC_ARG_ENABLE([float], AS_HELP_STRING([--disable-float], [disable floating-point arithmetic]))
AC_ARG_ENABLE([pic], AS_HELP_STRING([--disable-pic], [do not generate position-independent code]))
AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -Werror]))
dnl Features (disabled by default)
@ -102,7 +101,6 @@ AS_IF([test "$with_libc_all" = yes], do_with_libc_all)
dnl Features (enabled by default)
AS_IF([test "$enable_bloat" = no ], [enable_bloat=no], [enable_bloat=yes])
AS_IF([test "$enable_float" = no ], [enable_float=no], [enable_float=yes])
AS_IF([test "$enable_pic" = no ], [enable_pic=no], [enable_pic=yes])
AS_IF([test "$enable_werror" = no ], [enable_werror=no], [enable_werror=yes])
dnl Features (disabled by default)
@ -159,7 +157,6 @@ AM_CONDITIONAL([ASM_X86_64], [test "$host_cpu" = x86_64])
dnl Features (enabled by default)
AM_CONDITIONAL([ENABLE_BLOAT], [test "$enable_bloat" = yes])
AM_CONDITIONAL([ENABLE_FLOAT], [test "$enable_float" = yes])
AM_CONDITIONAL([ENABLE_PIC], [test "$enable_pic" = yes])
AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes])
dnl Features (disabled by default)
@ -202,7 +199,6 @@ AS_IF([test "$host_cpu" = x86_64], [AC_DEFINE([ASM_X86_64], [1]
dnl Features (enabled by default)
AS_IF([test "$enable_bloat" = yes], [AC_DEFINE([ENABLE_BLOAT], [1], [enabled unnecessary heavy binary data])])
AS_IF([test "$enable_float" = yes], [AC_DEFINE([ENABLE_FLOAT], [1], [enabled floating-point arithmetic])])
AS_IF([test "$enable_pic" = yes], [AC_DEFINE([ENABLE_PIC], [1], [generate position-independent code])])
AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR], [1], [enabled -Werror])])
dnl Features (disabled by default)
@ -266,12 +262,6 @@ AS_IF([test "$with_libc_strnlen" = no], [AC_SUBST([comment_line_libc_strnlen], [
AC_DEFUN([do_enable_pic], [CFLAGS+=' -fpic '])
AC_DEFUN([do_disable_pic], [CFLAGS+=' -fno-pic '])
AS_IF([test "$enable_pic" = yes], do_enable_pic, do_disable_pic)
AM_INIT_AUTOMAKE([1.9 subdir-objects])
AC_CONFIG_FILES([