[libstdc++] define zoneinfo_dir_override on vxworks

Message ID orcyqqf14d.fsf@lxoliva.fsfla.org
State Committed
Commit da3504ae4d1e6872585b1107a4932efd3824e943
Headers
Series [libstdc++] define zoneinfo_dir_override on vxworks |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed

Commit Message

Alexandre Oliva April 16, 2024, 3:16 a.m. UTC
  VxWorks fails to load kernel-mode modules with weak undefined symbols.
In RTP mode modules, that undergo final linking, weak undefined
symbols are not a problem.

This patch adds kernel-mode VxWorks multilibs to the set of targets
that don't support weak undefined symbols without special flags, in
which tzdb's zoneinfo_dir_override is given a weak definition.

Regstrapped on x86_64-linux-gnu.  Also tested with gcc-13 on arm-,
aarch64-, x86- and x86_64-vxworks7r2.  Ok to install?


for  libstdc++-v3/ChangeLog

	* src/c++20/tzdb.cc (__gnu_cxx::zoneinfo_dir_override): Define
	on VxWorks non-RTP.
---
 libstdc++-v3/src/c++20/tzdb.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Jonathan Wakely April 16, 2024, 6:37 a.m. UTC | #1
On Tue, 16 Apr 2024, 04:17 Alexandre Oliva, <oliva@adacore.com> wrote:

>
> VxWorks fails to load kernel-mode modules with weak undefined symbols.
> In RTP mode modules, that undergo final linking, weak undefined
> symbols are not a problem.
>
> This patch adds kernel-mode VxWorks multilibs to the set of targets
> that don't support weak undefined symbols without special flags, in
> which tzdb's zoneinfo_dir_override is given a weak definition.
>
> Regstrapped on x86_64-linux-gnu.  Also tested with gcc-13 on arm-,
> aarch64-, x86- and x86_64-vxworks7r2.  Ok to install?
>

OK, thanks.



>
> for  libstdc++-v3/ChangeLog
>
>         * src/c++20/tzdb.cc (__gnu_cxx::zoneinfo_dir_override): Define
>         on VxWorks non-RTP.
> ---
>  libstdc++-v3/src/c++20/tzdb.cc |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/src/c++20/tzdb.cc
> b/libstdc++-v3/src/c++20/tzdb.cc
> index 890a4c53e2d44..639d1c440ba16 100644
> --- a/libstdc++-v3/src/c++20/tzdb.cc
> +++ b/libstdc++-v3/src/c++20/tzdb.cc
> @@ -70,8 +70,9 @@ namespace __gnu_cxx
>  #else
>    [[gnu::weak]] const char* zoneinfo_dir_override();
>
> -#if defined(__APPLE__) || defined(__hpux__)
> -  // Need a weak definition for Mach-O.
> +#if defined(__APPLE__) || defined(__hpux__) \
> +  || (defined(__VXWORKS__) && !defined(__RTP__))
> +  // Need a weak definition for Mach-O et al.
>    [[gnu::weak]] const char* zoneinfo_dir_override()
>    {
>  #ifdef _GLIBCXX_ZONEINFO_DIR
>
> --
> Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
>    Free Software Activist                   GNU Toolchain Engineer
> More tolerance and less prejudice are key for inclusion and diversity
> Excluding neuro-others for not behaving ""normal"" is *not* inclusive
>
  

Patch

diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc
index 890a4c53e2d44..639d1c440ba16 100644
--- a/libstdc++-v3/src/c++20/tzdb.cc
+++ b/libstdc++-v3/src/c++20/tzdb.cc
@@ -70,8 +70,9 @@  namespace __gnu_cxx
 #else
   [[gnu::weak]] const char* zoneinfo_dir_override();
 
-#if defined(__APPLE__) || defined(__hpux__)
-  // Need a weak definition for Mach-O.
+#if defined(__APPLE__) || defined(__hpux__) \
+  || (defined(__VXWORKS__) && !defined(__RTP__))
+  // Need a weak definition for Mach-O et al.
   [[gnu::weak]] const char* zoneinfo_dir_override()
   {
 #ifdef _GLIBCXX_ZONEINFO_DIR