public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Olivier Hainque <hainque@adacore.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Olivier Hainque <hainque@adacore.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: [patch] Arrange to --disable-shared by default for VxWorks
Date: Thu, 29 Sep 2022 18:03:52 +0200	[thread overview]
Message-ID: <BCBA3471-2104-43F1-99BF-451007E33BA4@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

Hello,

Preparing a set of changes to support shared libs for VxWorks (again),
this patch makes sure that shared libraries for this family of targets
are only built on explicit request, when configured with --enable-shared
(by passing down --disable-shared to subdirs otherwise).

This provides us with a robust way to guard the relevant pieces in
other configure scripts and reduces the risks of accidentally breaking
a platform not yet ready for it, should enable-shared be implicitly
set without this change.

We have been using this for a while now in gcc-11 based production
toolchains with and without shared lib support (depending on the CPU).

I have performed a couple of build + test checks with gcc-12 for
powerpc64, then bootstrapped and regression tested on x86_64-linux.

Committing to mainline shortly.

Best Regards,

Olivier

2022-09-29  Olivier Hainque  <hainque@adacore.com>

        * configure.ac (*vxworks*): If enable_shared is not
        set, set to "no" and add --disable-shared to target and
        host_configargs.
        * configure: Regenerate.


[-- Attachment #2: 0008-Arrange-to-disable-shared-by-default-for-VxWorks.patch --]
[-- Type: application/octet-stream, Size: 2499 bytes --]

From 88abceef4baa9360a5042a7b2d7dd99348680c3a Mon Sep 17 00:00:00 2001
From: Olivier Hainque <hainque@adacore.com>
Date: Fri, 3 Dec 2021 17:48:18 +0000
Subject: [PATCH 08/18] Arrange to --disable-shared by default for VxWorks

Preparing a set of changes to support shared libs for VxWorks (again),
this patch makes sure that shared libraries for this family of targets
are only built on explicit request, when configured with --enable-shared
(by passing down --disable-shared to subdirs otherwise).

This provides us with a robust way to guard the relevant pieces in
other configure scripts and reduces the risks of accidentally breaking
a platform not yet ready for it, should enable-shared be implicitly
set without this change.

2022-09-29  Olivier Hainque  <hainque@adacore.com>

	* configure.ac (*vxworks*): If enable_shared is not
	set, set to "no" and add --disable-shared to target and
	host_configargs.
	* configure: Regenerate.
---
 configure    | 11 +++++++++++
 configure.ac | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/configure b/configure
index e7604dc6ff0..d9aa84c6138 100755
--- a/configure
+++ b/configure
@@ -10263,6 +10263,17 @@ case "${target}" in
   mep*)
     FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
     ;;
+  # The VxWorks support for shared libraries is getting in
+  # incrementally.  Make sure it doesn't get activated implicitly:
+  *vxworks*)
+    if test "${enable_shared-unset}" = unset ; then
+      enable_shared=no
+      # So the build of libraries knows ...
+      target_configargs="${target_configargs} --disable-shared"
+      # So gcc knows ...
+      host_configargs="${host_configargs} --disable-shared"
+    fi
+    ;;
 esac
 
 # Makefile fragments.
diff --git a/configure.ac b/configure.ac
index 3cfd9b41fca..2cff32e300e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3440,6 +3440,17 @@ case "${target}" in
   mep*)
     FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
     ;;
+  # The VxWorks support for shared libraries is getting in
+  # incrementally.  Make sure it doesn't get activated implicitly:
+  *vxworks*)
+    if test "${enable_shared-unset}" = unset ; then
+      enable_shared=no
+      # So the build of libraries knows ...
+      target_configargs="${target_configargs} --disable-shared"
+      # So gcc knows ...
+      host_configargs="${host_configargs} --disable-shared"
+    fi
+    ;;
 esac
 
 # Makefile fragments.
-- 
2.25.1


                 reply	other threads:[~2022-09-29 16:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=BCBA3471-2104-43F1-99BF-451007E33BA4@adacore.com \
    --to=hainque@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rasmus.villemoes@prevas.dk \
    /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).