Skip to content
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

[libc++] Remove obsolete Solaris and Newlib support for locales #113721

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Oct 25, 2024

The solaris header file doesn't even exist, so that's definitely dead code. The newlib header is empty, which means that localization can't work on that platform. If someone is using libc++ with Newlib, they must be providing LIBCXX_HAS_NO_LOCALIZATION today for anything to work, so that header is basically dead code as well.

The solaris header file doesn't even exist, so that's definitely dead
code. The newlib header is empty, which means that localization can't
work on that platform. If someone is using libc++ with Newlib, they
must be providing LIBCXX_HAS_NO_LOCALIZATION today for anything to
work, so that header is basically dead code as well.
@ldionne ldionne requested a review from a team as a code owner October 25, 2024 18:22
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Oct 25, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 25, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

The solaris header file doesn't even exist, so that's definitely dead code. The newlib header is empty, which means that localization can't work on that platform. If someone is using libc++ with Newlib, they must be providing LIBCXX_HAS_NO_LOCALIZATION today for anything to work, so that header is basically dead code as well.


Full diff: https://github.com/llvm/llvm-project/pull/113721.diff

4 Files Affected:

  • (modified) libcxx/include/CMakeLists.txt (-1)
  • (modified) libcxx/include/__locale_dir/locale_base_api.h (-4)
  • (removed) libcxx/include/__locale_dir/locale_base_api/newlib.h (-12)
  • (modified) libcxx/include/module.modulemap (-1)
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 63aa74e09bb1a2..506ed721d0843e 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -497,7 +497,6 @@ set(files
   __locale_dir/locale_base_api/fuchsia.h
   __locale_dir/locale_base_api/ibm.h
   __locale_dir/locale_base_api/musl.h
-  __locale_dir/locale_base_api/newlib.h
   __locale_dir/locale_base_api/openbsd.h
   __locale_dir/locale_base_api/win32.h
   __locale_dir/locale_guard.h
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
index 8c000c558c5279..eab7fa8bf62fae 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -15,10 +15,6 @@
 #  include <__locale_dir/locale_base_api/ibm.h>
 #elif defined(__ANDROID__)
 #  include <__locale_dir/locale_base_api/android.h>
-#elif defined(__sun__)
-#  include <__locale_dir/locale_base_api/solaris.h>
-#elif defined(_NEWLIB_VERSION)
-#  include <__locale_dir/locale_base_api/newlib.h>
 #elif defined(__OpenBSD__)
 #  include <__locale_dir/locale_base_api/openbsd.h>
 #elif defined(__Fuchsia__)
diff --git a/libcxx/include/__locale_dir/locale_base_api/newlib.h b/libcxx/include/__locale_dir/locale_base_api/newlib.h
deleted file mode 100644
index 7da10e5889843d..00000000000000
--- a/libcxx/include/__locale_dir/locale_base_api/newlib.h
+++ /dev/null
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_NEWLIB_H
-#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_NEWLIB_H
-
-#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_NEWLIB_H
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index c79070c318759d..f92e8bf5fc9aba 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1451,7 +1451,6 @@ module std [system] {
       textual header "__locale_dir/locale_base_api/fuchsia.h"
       textual header "__locale_dir/locale_base_api/ibm.h"
       textual header "__locale_dir/locale_base_api/musl.h"
-      textual header "__locale_dir/locale_base_api/newlib.h"
       textual header "__locale_dir/locale_base_api/openbsd.h"
       textual header "__locale_dir/locale_base_api/win32.h"
     }

@ldionne ldionne merged commit cfde4fb into llvm:main Oct 25, 2024
65 checks passed
@ldionne ldionne deleted the review/locale-3-remove-obsolete branch October 25, 2024 20:46
winner245 pushed a commit to winner245/llvm-project that referenced this pull request Oct 26, 2024
…#113721)

The solaris header file doesn't even exist, so that's definitely dead
code. The newlib header is empty, which means that localization can't
work on that platform. If someone is using libc++ with Newlib, they must
be providing LIBCXX_HAS_NO_LOCALIZATION today for anything to work, so
that header is basically dead code as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants