Skip to content

[libc] Move the internal extern "C" symbols inside the namespace #98232

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

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

petrhosek
Copy link
Member

This ensures that these symbols inherit the namespace visibility.

This ensures that these symbols inherit the namespace visibility.
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2024

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

This ensures that these symbols inherit the namespace visibility.


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

5 Files Affected:

  • (modified) libc/src/__support/OSUtil/baremetal/exit.cpp (+2-2)
  • (modified) libc/src/__support/OSUtil/baremetal/io.cpp (+2-2)
  • (modified) libc/src/stdlib/exit.cpp (+2-2)
  • (modified) libc/startup/baremetal/fini.cpp (+2-2)
  • (modified) libc/startup/baremetal/init.cpp (+2-2)
diff --git a/libc/src/__support/OSUtil/baremetal/exit.cpp b/libc/src/__support/OSUtil/baremetal/exit.cpp
index 08473f7f3b00b..26088c28b0a50 100644
--- a/libc/src/__support/OSUtil/baremetal/exit.cpp
+++ b/libc/src/__support/OSUtil/baremetal/exit.cpp
@@ -8,11 +8,11 @@
 
 #include "src/__support/OSUtil/exit.h"
 
+namespace LIBC_NAMESPACE::internal {
+
 // This is intended to be provided by the vendor.
 extern "C" [[noreturn]] void __llvm_libc_exit(int status);
 
-namespace LIBC_NAMESPACE::internal {
-
 [[noreturn]] void exit(int status) { __llvm_libc_exit(status); }
 
 } // namespace LIBC_NAMESPACE::internal
diff --git a/libc/src/__support/OSUtil/baremetal/io.cpp b/libc/src/__support/OSUtil/baremetal/io.cpp
index 5dd92e4a56ce4..c97bd5ae65b13 100644
--- a/libc/src/__support/OSUtil/baremetal/io.cpp
+++ b/libc/src/__support/OSUtil/baremetal/io.cpp
@@ -10,6 +10,8 @@
 
 #include "src/__support/CPP/string_view.h"
 
+namespace LIBC_NAMESPACE {
+
 // This is intended to be provided by the vendor.
 
 extern struct __llvm_libc_stdin __llvm_libc_stdin;
@@ -17,8 +19,6 @@ extern "C" ssize_t __llvm_libc_stdin_read(void *cookie, char *buf, size_t size);
 
 extern "C" void __llvm_libc_log_write(const char *msg, size_t len);
 
-namespace LIBC_NAMESPACE {
-
 ssize_t read_from_stdin(char *buf, size_t size) {
   return __llvm_libc_stdin_read(reinterpret_cast<void *>(&__llvm_libc_stdin),
                                 buf, size);
diff --git a/libc/src/stdlib/exit.cpp b/libc/src/stdlib/exit.cpp
index 1f7ccbb556607..1afeec5a460da 100644
--- a/libc/src/stdlib/exit.cpp
+++ b/libc/src/stdlib/exit.cpp
@@ -10,10 +10,10 @@
 #include "src/__support/OSUtil/exit.h"
 #include "src/__support/common.h"
 
-extern "C" void __cxa_finalize(void *);
-
 namespace LIBC_NAMESPACE {
 
+extern "C" void __cxa_finalize(void *);
+
 [[noreturn]] LLVM_LIBC_FUNCTION(void, exit, (int status)) {
   __cxa_finalize(nullptr);
   internal::exit(status);
diff --git a/libc/startup/baremetal/fini.cpp b/libc/startup/baremetal/fini.cpp
index 84997fb4fa1d8..745bd094b24fe 100644
--- a/libc/startup/baremetal/fini.cpp
+++ b/libc/startup/baremetal/fini.cpp
@@ -9,13 +9,13 @@
 #include <stddef.h>
 #include <stdint.h>
 
+namespace LIBC_NAMESPACE {
+
 extern "C" {
 extern uintptr_t __fini_array_start[];
 extern uintptr_t __fini_array_end[];
 }
 
-namespace LIBC_NAMESPACE {
-
 using FiniCallback = void(void);
 
 extern "C" void __libc_fini_array(void) {
diff --git a/libc/startup/baremetal/init.cpp b/libc/startup/baremetal/init.cpp
index 08dff74f05198..21ec0e5ca756d 100644
--- a/libc/startup/baremetal/init.cpp
+++ b/libc/startup/baremetal/init.cpp
@@ -9,6 +9,8 @@
 #include <stddef.h>
 #include <stdint.h>
 
+namespace LIBC_NAMESPACE {
+
 extern "C" {
 extern uintptr_t __preinit_array_start[];
 extern uintptr_t __preinit_array_end[];
@@ -16,8 +18,6 @@ extern uintptr_t __init_array_start[];
 extern uintptr_t __init_array_end[];
 }
 
-namespace LIBC_NAMESPACE {
-
 using InitCallback = void(void);
 
 extern "C" void __libc_init_array(void) {

@petrhosek petrhosek merged commit be9b1de into llvm:main Jul 9, 2024
6 of 7 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 9, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-dbg running on libc-x86_64-debian while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/93/builds/1707

Here is the relevant piece of the build log for the reference:

Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/13] Building CXX object projects/libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/fcntl.cpp.o
[2/13] Building CXX object projects/libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
[3/13] Building CXX object projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o
FAILED: projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/src/stdio/generic -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/src/stdio/generic -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fpie -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY=1 -std=c++17 -MD -MT projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o -MF projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o.d -o projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/src/stdio/generic/fileno.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/src/__support/File/file.h:12:
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/hdr/stdio_macros.h:19:
In file included from /usr/include/stdio.h:42:
/usr/include/x86_64-linux-gnu/bits/types/FILE.h:7:25: error: typedef redefinition with different types ('struct _IO_FILE' vs 'struct FILE')
typedef struct _IO_FILE FILE;
                        ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-project/libc/include/llvm-libc-types/FILE.h:12:21: note: previous definition is here
typedef struct FILE FILE;
                    ^
1 error generated.
[4/13] Building CXX object projects/libc/src/stdio/linux/CMakeFiles/libc.src.stdio.linux.fdopen.dir/fdopen.cpp.o
[5/13] Building CXX object projects/libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o
[6/13] Building CXX object projects/libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o
[7/13] Building CXX object projects/libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.file.dir/file.cpp.o
[8/13] Building CXX object projects/libc/src/__support/File/CMakeFiles/libc.src.__support.File.file.dir/file.cpp.o
[9/13] Building CXX object projects/libc/src/stdio/CMakeFiles/libc.src.stdio.fprintf.dir/fprintf.cpp.o
[10/13] Building CXX object projects/libc/src/stdio/CMakeFiles/libc.src.stdio.vfprintf.dir/vfprintf.cpp.o
[11/13] Building CXX object projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.printf.dir/printf.cpp.o
[12/13] Building CXX object projects/libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.vprintf.dir/vprintf.cpp.o
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 121, in main
    run_command(['ninja', 'libc'])
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', 'libc']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
@@@BUILD_STEP libc-unit-tests@@@

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 9, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-dbg-runtimes-build running on libc-x86_64-debian while building libc at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/78/builds/1606

Here is the relevant piece of the build log for the reference:

Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
-- Skipping test for 'libc.src.string.memcpy_x86_64_opt_avx512' insufficient host cpu features 'AVX512F'
-- Skipping test for 'libc.src.string.memmove_x86_64_opt_avx512' insufficient host cpu features 'AVX512F'
-- Skipping test for 'libc.src.string.memset_x86_64_opt_avx512' insufficient host cpu features 'AVX512F'
-- check-runtimes does nothing.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins
[1/13] Building CXX object libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/fcntl.cpp.o
[2/13] Building CXX object libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
[3/13] Building CXX object libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o
FAILED: libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o 
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fpie -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY=1 -std=gnu++17 -MD -MT libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o -MF libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o.d -o libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/src/stdio/generic/fileno.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/src/__support/File/file.h:12:
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/hdr/stdio_macros.h:19:
In file included from /usr/include/stdio.h:42:
/usr/include/x86_64-linux-gnu/bits/types/FILE.h:7:25: error: typedef redefinition with different types ('struct _IO_FILE' vs 'struct FILE')
    7 | typedef struct _IO_FILE FILE;
      |                         ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/include/llvm-libc-types/FILE.h:12:21: note: previous definition is here
   12 | typedef struct FILE FILE;
      |                     ^
1 error generated.
[4/13] Building CXX object libc/src/stdio/linux/CMakeFiles/libc.src.stdio.linux.fdopen.dir/fdopen.cpp.o
[5/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o
[6/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o
[7/13] Building CXX object libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.file.dir/file.cpp.o
[8/13] Building CXX object libc/src/__support/File/CMakeFiles/libc.src.__support.File.file.dir/file.cpp.o
[9/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.vfprintf.dir/vfprintf.cpp.o
[10/13] Building CXX object libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.vprintf.dir/vprintf.cpp.o
[11/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.fprintf.dir/fprintf.cpp.o
[12/13] Building CXX object libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.printf.dir/printf.cpp.o
ninja: build stopped: subcommand failed.
FAILED: runtimes/CMakeFiles/libc /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/CMakeFiles/libc 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins && /usr/bin/cmake --build /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins/ --target libc --config Debug
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 121, in main
    run_command(['ninja', 'libc'])
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
Step 6 (build libc) failure: build libc (failure)
...
-- Skipping test for 'libc.src.string.memcpy_x86_64_opt_avx512' insufficient host cpu features 'AVX512F'
-- Skipping test for 'libc.src.string.memmove_x86_64_opt_avx512' insufficient host cpu features 'AVX512F'
-- Skipping test for 'libc.src.string.memset_x86_64_opt_avx512' insufficient host cpu features 'AVX512F'
-- check-runtimes does nothing.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins
[1/13] Building CXX object libc/src/__support/OSUtil/linux/CMakeFiles/libc.src.__support.OSUtil.linux.linux_util.dir/fcntl.cpp.o
[2/13] Building CXX object libc/src/unistd/linux/CMakeFiles/libc.src.unistd.linux.lseek.dir/lseek.cpp.o
[3/13] Building CXX object libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o
FAILED: libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o 
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fpie -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -DLIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY=1 -std=gnu++17 -MD -MT libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o -MF libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o.d -o libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.fileno.dir/fileno.cpp.o -c /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/src/stdio/generic/fileno.cpp
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/src/__support/File/file.h:12:
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/hdr/stdio_macros.h:19:
In file included from /usr/include/stdio.h:42:
/usr/include/x86_64-linux-gnu/bits/types/FILE.h:7:25: error: typedef redefinition with different types ('struct _IO_FILE' vs 'struct FILE')
    7 | typedef struct _IO_FILE FILE;
      |                         ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-project/libc/include/llvm-libc-types/FILE.h:12:21: note: previous definition is here
   12 | typedef struct FILE FILE;
      |                     ^
1 error generated.
[4/13] Building CXX object libc/src/stdio/linux/CMakeFiles/libc.src.stdio.linux.fdopen.dir/fdopen.cpp.o
[5/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.fscanf.dir/fscanf.cpp.o
[6/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.scanf.dir/scanf.cpp.o
[7/13] Building CXX object libc/src/__support/File/linux/CMakeFiles/libc.src.__support.File.linux.file.dir/file.cpp.o
[8/13] Building CXX object libc/src/__support/File/CMakeFiles/libc.src.__support.File.file.dir/file.cpp.o
[9/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.vfprintf.dir/vfprintf.cpp.o
[10/13] Building CXX object libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.vprintf.dir/vprintf.cpp.o
[11/13] Building CXX object libc/src/stdio/CMakeFiles/libc.src.stdio.fprintf.dir/fprintf.cpp.o
[12/13] Building CXX object libc/src/stdio/generic/CMakeFiles/libc.src.stdio.generic.printf.dir/printf.cpp.o
ninja: build stopped: subcommand failed.
FAILED: runtimes/CMakeFiles/libc /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/CMakeFiles/libc 
cd /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins && /usr/bin/cmake --build /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/runtimes/runtimes-bins/ --target libc --config Debug
ninja: build stopped: subcommand failed.
['ninja', 'libc'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 164, in step
    yield
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 121, in main
    run_command(['ninja', 'libc'])
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/build/../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py", line 179, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/llvm-libc-buildbot/home/sivachandra/libc-x86_64-debian/libc-x86_64-debian-dbg-runtimes-build/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)

aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
…m#98232)

This ensures that these symbols inherit the namespace visibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants