Skip to content

Commit f4a8018

Browse files
[libc] Move fileno and fdopen to fullbuild only (llvm#128762)
Both fileno and fdopen require interfacing with the opaque FILE struct, so they shouldn't be enabled in overlay mode. This patch moves both into fullbuild only on all platforms. Fixes llvm#128643
1 parent 44ffeec commit f4a8018

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ set(TARGET_LIBC_ENTRYPOINTS
212212
libc.src.stdlib.realloc
213213

214214
# stdio.h entrypoints
215-
libc.src.stdio.fdopen
216-
libc.src.stdio.fileno
217215
libc.src.stdio.fprintf
218216
libc.src.stdio.fscanf
219217
libc.src.stdio.vfscanf
@@ -918,6 +916,7 @@ if(LLVM_LIBC_FULL_BUILD)
918916
libc.src.stdio.clearerr
919917
libc.src.stdio.clearerr_unlocked
920918
libc.src.stdio.fclose
919+
libc.src.stdio.fdopen
921920
libc.src.stdio.feof
922921
libc.src.stdio.feof_unlocked
923922
libc.src.stdio.ferror
@@ -926,6 +925,7 @@ if(LLVM_LIBC_FULL_BUILD)
926925
libc.src.stdio.fgetc
927926
libc.src.stdio.fgetc_unlocked
928927
libc.src.stdio.fgets
928+
libc.src.stdio.fileno
929929
libc.src.stdio.flockfile
930930
libc.src.stdio.fopen
931931
libc.src.stdio.fopencookie

libc/config/linux/riscv/entrypoints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ set(TARGET_LIBC_ENTRYPOINTS
211211
libc.src.stdlib.realloc
212212

213213
# stdio.h entrypoints
214-
libc.src.stdio.fdopen
215-
libc.src.stdio.fileno
216214
libc.src.stdio.fprintf
217215
libc.src.stdio.fscanf
218216
libc.src.stdio.vfscanf
@@ -857,6 +855,7 @@ if(LLVM_LIBC_FULL_BUILD)
857855
libc.src.stdio.clearerr
858856
libc.src.stdio.clearerr_unlocked
859857
libc.src.stdio.fclose
858+
libc.src.stdio.fdopen
860859
libc.src.stdio.feof
861860
libc.src.stdio.feof_unlocked
862861
libc.src.stdio.ferror
@@ -865,6 +864,7 @@ if(LLVM_LIBC_FULL_BUILD)
865864
libc.src.stdio.fgetc
866865
libc.src.stdio.fgetc_unlocked
867866
libc.src.stdio.fgets
867+
libc.src.stdio.fileno
868868
libc.src.stdio.flockfile
869869
libc.src.stdio.fopen
870870
libc.src.stdio.fopencookie

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ set(TARGET_LIBC_ENTRYPOINTS
211211
libc.src.stdlib.realloc
212212

213213
# stdio.h entrypoints
214-
libc.src.stdio.fdopen
215-
libc.src.stdio.fileno
216214
libc.src.stdio.fprintf
217215
libc.src.stdio.fscanf
218216
libc.src.stdio.vfscanf
@@ -1018,6 +1016,7 @@ if(LLVM_LIBC_FULL_BUILD)
10181016
libc.src.stdio.clearerr
10191017
libc.src.stdio.clearerr_unlocked
10201018
libc.src.stdio.fclose
1019+
libc.src.stdio.fdopen
10211020
libc.src.stdio.feof
10221021
libc.src.stdio.feof_unlocked
10231022
libc.src.stdio.ferror
@@ -1026,6 +1025,7 @@ if(LLVM_LIBC_FULL_BUILD)
10261025
libc.src.stdio.fgetc
10271026
libc.src.stdio.fgetc_unlocked
10281027
libc.src.stdio.fgets
1028+
libc.src.stdio.fileno
10291029
libc.src.stdio.flockfile
10301030
libc.src.stdio.fopen
10311031
libc.src.stdio.fopencookie

libc/src/stdio/generic/fileno.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//===-- Implementation of fileno
2-
//-------------------------------------------===//
1+
//===-- Implementation of fileno ------------------------------------------===//
32
//
43
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
54
// See https://llvm.org/LICENSE.txt for license information.

0 commit comments

Comments
 (0)