public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: newlib@sourceware.org
Subject: [PATCH 1/6] newlib: drop i?86-pc-linux-* target support
Date: Mon,  7 Feb 2022 20:57:01 -0500	[thread overview]
Message-ID: <20220208015706.6482-2-vapier@gentoo.org> (raw)
In-Reply-To: <20220208015706.6482-1-vapier@gentoo.org>

This was added 20+ years ago.  It seems to have very few (or no users)
as it only works on 32-bit x86 GNU/Linux (i.e. glibc) systems, and even
then only with old versions of glibc.  It hasn't compiled in at least 5
years, but most likely been broken for more like 15 years -- it relies
on internal glibc APIs (like linuxthreads), and that code has changed
and been deleted significantly since.

This single target ends up dragging in a lot of non-trivial code that is
hard to keep working, and currently impossible to verify -- the libtool
and iconvdata and sys/linux/ code isn't used by anything else, but ends
up touching just about every build file in the tree.  Punt the target so
we can start stripping out all these unique code paths.

This commit by itself just disables the target.  We'll start deleting the
individual unused pieces in followups.
---
 newlib/NEWS           |  4 ++++
 newlib/README         | 34 ----------------------------------
 newlib/configure      |  5 -----
 newlib/configure.ac   |  5 -----
 newlib/configure.host | 40 +---------------------------------------
 5 files changed, 5 insertions(+), 83 deletions(-)

diff --git a/newlib/NEWS b/newlib/NEWS
index fdca12ab9213..d007aac3da70 100644
--- a/newlib/NEWS
+++ b/newlib/NEWS
@@ -1,3 +1,7 @@
+*** Major changes in newlib version 4.3.0:
+
+- remove i?86-pc-linux-gnu support
+
 *** Major changes in newlib version 4.2.0:
 
 - remove use of --cygnus option for automake
diff --git a/newlib/README b/newlib/README
index c025cb38d0c4..aa48b246f968 100644
--- a/newlib/README
+++ b/newlib/README
@@ -508,40 +508,6 @@ need to add the other targets you're testing to the case statement.
 Now type make check-target-newlib in the top-level build directory to
 run the testsuite.
 
-Shared newlib
-=============
-
-newlib uses libtool when it is being compiled natively (with
---target=i[34567]86-pc-linux-gnu) on an i[34567]86-pc-linux-gnu
-host. This allows newlib to be compiled as a shared library.
-
-To configure newlib, do the following from your build directory:
-
-$(source_dir)/src/configure --with-newlib --prefix=$(install_dir)
-
-configure will recognize that host == target ==
-i[34567]86-pc-linux-gnu, so it will tell newlib to compile itself using
-libtool. By default, libtool will build shared and static versions of
-newlib.
-
-To compile a program against shared newlib, do the following (where
-target_install_dir = $(install_dir)/i[34567]86-pc-linux-gnu):
-
-gcc -nostdlib $(target_install_dir)/lib/crt0.o progname.c -I $(target_install_dir)/include -L $(target_install_dir)/lib -lc -lm -lgcc
-
-To run the program, make sure that $(target_install_dir)/lib is listed
-in the LD_LIBRARY_PATH environment variable.
-
-To create a static binary linked against newlib, do the following:
-
-gcc -nostdlib -static $(target_install_dir)/lib/crt0.o progname.c -I $(target_install_dir)/include -L $(target_install_dir)/lib -lc -lm
-
-libtool can be instructed to produce only static libraries. To build
-newlib as a static library only, do the following from your build
-directory:
-
-$(source_dir)/src/configure --with-newlib --prefix=$(install_dir) --disable-shared
-
 Regenerating Configuration Files
 ================================
 
diff --git a/newlib/configure.ac b/newlib/configure.ac
index 2e6a80a5f8b3..366fffafcff3 100644
--- a/newlib/configure.ac
+++ b/newlib/configure.ac
@@ -348,11 +348,6 @@ AM_CONDITIONAL(HAVE_DOC, test x$have_multisubdir = xno)
 AM_CONDITIONAL(HAVE_MULTISUBDIR, test x$have_multisubdir = xyes)
 
 HAVE_ICONVDATA=false
-case $host in
-  i[[34567]]86-pc-linux-*)
-	HAVE_ICONVDATA=true
-	;;
-esac
 AM_CONDITIONAL([HAVE_ICONVDATA], $HAVE_ICONVDATA)
 
 CRT0=
diff --git a/newlib/configure.host b/newlib/configure.host
index 893a698ed6d9..4eae14063462 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -406,7 +406,7 @@ fi
 
 if [ "x${newlib_mb}" = "x" ]; then
 	case "${host}" in
-  	  i[34567]86-pc-linux-*|*-*-cygwin*)
+	  *-*-cygwin*)
 		newlib_mb=yes
 	  	;;
 	esac
@@ -418,21 +418,6 @@ if [ "${newlib_io_float}" = "no" ] ; then
 	newlib_cflags="${newlib_cflags} -DNO_FLOATING_POINT"
 fi
 
-# Verify if shared newlib support is allowed and set appropriate variables
-# We don't want to use libtool for platforms that we are not going to
-# support shared libraries.  This is because it adds executable tests which
-# we don't want for most embedded platforms.
-case "${host}" in
-  i[34567]86-pc-linux-*)
-    use_libtool=yes
-    have_sys_mach_dir=yes
-    stdio64_dir=stdio64
-    oext=lo
-    lpfx=
-    aext=la ;;
-  *) ;; #shared library not supported for ${host}
-esac
-
 # Get the source directories to use for the host.  unix_dir is set
 # to unix to get some standard Unix routines.  posix_dir is set to get some
 # standard Posix routines.  sys_dir should supply system dependent routines
@@ -530,29 +515,6 @@ case "${host}" in
 	sys_dir=sysvi386
 	unix_dir=unix
 	;;
-  i[34567]86-pc-linux-*)
-	sys_dir=linux
-	unix_dir=unix
-	posix_dir=posix
-	crt1=crt1.o
-	crt1_dir=libc/sys/${sys_dir}	
-	gcc_dir=`gcc -print-search-dirs | awk '/^install:/{print $2}'`
-	default_newlib_io_c99_formats="yes"
-	default_newlib_io_long_double="yes"
-	default_newlib_io_long_long="yes"
-	default_newlib_io_pos_args="yes"
-	#newlib_cflags="${newlib_cflags} -Werror" # DEBUGGING ONLY;BREAKS BUILD
-	newlib_cflags="${newlib_cflags} -Wall"
-	newlib_cflags="${newlib_cflags} -DHAVE_FCNTL"
-	newlib_cflags="${newlib_cflags} -DHAVE_GETOPT"
-	newlib_cflags="${newlib_cflags} -D_NO_POSIX_SPAWN"
-	# --- Required when building a shared library ------------------------
-	newlib_cflags="${newlib_cflags} -fPIC -D_I386MACH_NEED_SOTYPE_FUNCTION"
-	# --- The three lines below are optional ------------------------------
-	##newlib_cflags="${newlib_cflags} -nostdinc"
-	##newlib_cflags="${newlib_cflags} -I`newlib-flags --kernel-dir`/include"
-	##newlib_cflags="${newlib_cflags} -idirafter ${gcc_dir}include"
-	;;
 
   m68hc11-*-*|m6811-*-*|m6812-*-*|m68hc12-*-*)
 	;;
-- 
2.34.1


  reply	other threads:[~2022-02-08  1:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07  9:27 can i delete libtool / shared library support ? Mike Frysinger
2022-02-07 10:30 ` Mike Frysinger
2022-02-07 11:48 ` Corinna Vinschen
2022-02-07 19:30   ` Jeff Johnston
2022-02-08  1:57 ` [PATCH 0/6] delete i?86-pc-linux-gnu & libtool support Mike Frysinger
2022-02-08  1:57   ` Mike Frysinger [this message]
2022-02-08  1:57   ` [PATCH 2/6] newlib: punt sys/linux support Mike Frysinger
2022-02-08  1:57   ` [PATCH 3/6] newlib: drop unused iconvdata Mike Frysinger
2022-02-08  4:55     ` Joel Sherrill
2022-02-08  1:57   ` [PATCH 4/6] newlib: drop libtool support Mike Frysinger
2022-02-08  9:47     ` Corinna Vinschen
2022-02-09  0:20       ` Mike Frysinger
2022-02-09 10:54         ` Corinna Vinschen
2022-02-09  8:41       ` Brian Inglis
2022-02-09 10:55         ` Corinna Vinschen
2022-02-08  1:57   ` [PATCH 5/6] newlib: drop support for $aext Mike Frysinger
2022-02-08  1:57   ` [PATCH 6/6] newlib: drop support for $oext Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220208015706.6482-2-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).