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] Use stdio.h for off_t instead of unistd.h #98093

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Jul 8, 2024

Summary:
The stdio.h header should define off_t as defined for the platform.
This will use the system's in overlay mode, or what the llvm-libc-types
deems correct. If this off_t is incorrect it should be changed in
llvm-libc-types. This fixes the GPU build.

Summary:
The `stdio.h` header should define `off_t` as defined for the platform.
This will use the system's in overlay mode, or what the llvm-libc-types
deems correct. If this `off_t` is incorrect it should be changed in
`llvm-libc-types`. This fixes the GPU build.
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 8, 2024

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

Changes

Summary:
The stdio.h header should define off_t as defined for the platform.
This will use the system's in overlay mode, or what the llvm-libc-types
deems correct. If this off_t is incorrect it should be changed in
llvm-libc-types. This fixes the GPU build.


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

1 Files Affected:

  • (modified) libc/src/__support/File/file.h (+1-1)
diff --git a/libc/src/__support/File/file.h b/libc/src/__support/File/file.h
index ec543ac1ac5f3..828e71424c593 100644
--- a/libc/src/__support/File/file.h
+++ b/libc/src/__support/File/file.h
@@ -16,7 +16,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <unistd.h> // For off_t.
+#include <stdio.h>
 
 namespace LIBC_NAMESPACE {
 

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as a fix for now

@@ -16,7 +16,7 @@

#include <stddef.h>
#include <stdint.h>
#include <unistd.h> // For off_t.
#include <stdio.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a TODO to move these to proper proxy header?

Copy link
Member

@mikhailramalho mikhailramalho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no regressions on rv32, thanks for the fix

@jhuber6 jhuber6 merged commit 673b6cd 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 running on libc-x86_64-debian while building libc at step 4 "annotate".

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

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_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- 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/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/11] 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 -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/build/projects/libc/src/stdio/generic -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/src/stdio/generic -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/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 -ffunction-sections -fdata-sections -O3 -DNDEBUG -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/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/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/llvm-project/libc/src/__support/File/file.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/llvm-project/libc/include/llvm-libc-types/FILE.h:12:21: note: previous definition is here
typedef struct FILE FILE;
                    ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/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/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:902:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'
  return __getc_unlocked_body (__fp);
         ^
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:103:27: note: expanded from macro '__getc_unlocked_body'
  (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end)        \
                          ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
typedef struct FILE FILE;
               ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/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/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:902:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'
  return __getc_unlocked_body (__fp);
         ^
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:103:50: note: expanded from macro '__getc_unlocked_body'
  (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end)        \
                                                 ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
typedef struct FILE FILE;
               ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian/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/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:902:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'

@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-asan running on libc-x86_64-debian while building libc at step 4 "annotate".

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

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_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- 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-asan/build
@@@BUILD_STEP build libc@@@
Running: ninja libc
[1/11] 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-asan/build/projects/libc/src/stdio/generic -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/src/stdio/generic -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/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 -fno-omit-frame-pointer -O1 -fsanitize=address -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-asan/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-asan/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-asan/llvm-project/libc/src/__support/File/file.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-asan/llvm-project/libc/include/llvm-libc-types/FILE.h:12:21: note: previous definition is here
typedef struct FILE FILE;
                    ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/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-asan/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:902:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'
  return __getc_unlocked_body (__fp);
         ^
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:103:27: note: expanded from macro '__getc_unlocked_body'
  (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end)        \
                          ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
typedef struct FILE FILE;
               ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/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-asan/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:902:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'
  return __getc_unlocked_body (__fp);
         ^
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:103:50: note: expanded from macro '__getc_unlocked_body'
  (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end)        \
                                                 ^
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
typedef struct FILE FILE;
               ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian/libc-x86_64-debian-dbg-asan/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-asan/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:902:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 9, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building libc at step 6 "build-unified-tree".

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

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

Step 6 (build-unified-tree) failure: build (failure)
...
0.023 [6/14/1] Building CXX object compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic_version_script_dummy.x86_64.dir/dummy.cpp.o
0.029 [5/14/2] Building CXX object compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_dynamic_version_script_dummy.x86_64.dir/dummy.cpp.o
0.030 [4/14/3] Building CXX object compiler-rt/lib/hwasan/CMakeFiles/RTHwasan_dynamic_version_script_dummy.x86_64.dir/dummy.cpp.o
0.031 [2/15/4] Building CXX object compiler-rt/lib/memprof/CMakeFiles/RTMemprof_dynamic_version_script_dummy.x86_64.dir/dummy.cpp.o
0.083 [1/15/5] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
0.084 [1/14/6] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan.so
0.088 [1/13/7] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan_aliases.so
0.093 [1/12/8] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.memprof.so
0.096 [1/11/9] Linking CXX shared library /build/buildbot/premerge-monolithic-linux/build/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so
0.122 [1/10/10] 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 
/build/buildbot/premerge-monolithic-linux/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -I/build/buildbot/premerge-monolithic-linux/llvm-project/libc -isystem /build/buildbot/premerge-monolithic-linux/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 -ffunction-sections -fdata-sections -O3 -DNDEBUG -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 -UNDEBUG -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 /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/stdio/generic/fileno.cpp
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/__support/File/file.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;
      |                         ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libc/include/llvm-libc-types/FILE.h:12:21: note: previous definition is here
   12 | typedef struct FILE FILE;
      |                     ^
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:891:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'
   58 |   return __getc_unlocked_body (__fp);
      |          ^
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:103:27: note: expanded from macro '__getc_unlocked_body'
  103 |   (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end)        \
      |                           ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
   12 | typedef struct FILE FILE;
      |                ^
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:891:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'
   58 |   return __getc_unlocked_body (__fp);
      |          ^
/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h:103:50: note: expanded from macro '__getc_unlocked_body'
  103 |   (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end)        \
      |                                                  ^
/build/buildbot/premerge-monolithic-linux/llvm-project/libc/include/llvm-libc-types/FILE.h:12:16: note: forward declaration of 'FILE'
   12 | typedef struct FILE FILE;
      |                ^
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/stdio/generic/fileno.cpp:13:
In file included from /build/buildbot/premerge-monolithic-linux/llvm-project/libc/src/__support/File/file.h:19:
In file included from /usr/include/stdio.h:891:
/usr/include/x86_64-linux-gnu/bits/stdio.h:58:10: error: member access into incomplete type 'FILE'

aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Summary:
The `stdio.h` header should define `off_t` as defined for the platform.
This will use the system's in overlay mode, or what the llvm-libc-types
deems correct. If this `off_t` is incorrect it should be changed in
`llvm-libc-types`. This fixes the GPU build.
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