Skip to content

Commit 7447daf

Browse files
CaslynCQ Bot
authored andcommitted
[libc] Complete soft migration of files to /strings
This removes the exec script and old location targets for files that were moved to /strings. This is blocked on the merging of llvm/llvm-project#119623 into Fuchsia. Fixed: 383347626 Change-Id: Ia8de544a2695125f888544071b08f37906fe381d Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1172249 Reviewed-by: David Fang <[email protected]> Fuchsia-Auto-Submit: Caslyn Tonelli <[email protected]> Commit-Queue: Auto-Submit <[email protected]> Reviewed-by: Roland McGrath <[email protected]>
1 parent 57d3293 commit 7447daf

File tree

7 files changed

+39
-107
lines changed

7 files changed

+39
-107
lines changed

.gn

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ exec_script_whitelist = [
4747
"//build/toolchain/default_concurrent_jobs.gni",
4848
"//build/toolchain/zircon/zircon_toolchain.gni",
4949
"//zircon/kernel/arch/x86/phys/BUILD.gn",
50-
51-
# TODO(https://fxbug.dev/383347626): This is temporary to perform soft-migration.
52-
"//zircon/system/ulib/c/string/file_exists_check.gni",
5350
]
5451

5552
check_system_includes = true

sdk/lib/ld/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ static_library("standalone") {
324324
"//zircon/system/public",
325325
"//zircon/system/ulib/c/stdlib:hermetic",
326326
"//zircon/system/ulib/c/string:hermetic",
327+
"//zircon/system/ulib/c/strings:hermetic",
327328
]
328329

329330
if (is_linux) {

zircon/system/ulib/c/BUILD.gn

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import("//build/toolchain/ifs_shared_library.gni")
1111
import("//build/zircon/migrated_targets.gni")
1212
import("libc.gni")
1313
import("libc_toolchain.gni")
14-
import("string/file_exists_check.gni")
1514

1615
assert(libc == get_path_info(get_path_info(".", "abspath"), "dir"),
1716
get_path_info(get_path_info(".", "abspath"), "dir"))
@@ -34,15 +33,15 @@ libc_components = [
3433
libc_testonly_components = []
3534

3635
if (use_llvm_libc_string_functions) {
37-
libc_components += [ "string" ]
38-
if (!file_exists_in_string) {
39-
libc_components += [ "strings" ]
40-
}
36+
libc_components += [
37+
"string",
38+
"strings",
39+
]
4140
} else {
42-
libc_testonly_components += [ "string" ]
43-
if (!file_exists_in_string) {
44-
libc_testonly_components += [ "strings" ]
45-
}
41+
libc_testonly_components += [
42+
"string",
43+
"strings",
44+
]
4645
}
4746

4847
group("components") {

zircon/system/ulib/c/string/BUILD.gn

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33
# found in the LICENSE file.
44

55
import("../libc.gni")
6-
import("file_exists_check.gni")
76

87
llvm_libc_group("string") {
98
deps = [
109
":mem",
1110
":str",
1211
]
1312

14-
# TODO(https://fxbug.dev/383347626): these files are moved from string/ to
15-
# strings/ after llvm rev 431ea2d076f8a5ca35b2c293dd5d62f5ce083f45
16-
if (file_exists_in_string) {
17-
deps += [ ":compat" ]
18-
}
19-
2013
# TODO(https://fxbug.dev/42053650): not yet using the llvm-libc versions of these
2114
non_test_deps = [
2215
"//zircon/third_party/ulib/musl/src/string:strerror_r",
@@ -197,15 +190,6 @@ llvm_libc_source_set("str") {
197190
]
198191

199192
deps = [ ":minimal-str" ]
200-
201-
# TODO(https://fxbug.dev/383347626): these files are moved from string/ to
202-
# strings/ after llvm rev 431ea2d076f8a5ca35b2c293dd5d62f5ce083f45
203-
if (file_exists_in_string) {
204-
functions += [
205-
"strncasecmp",
206-
"strcasecmp",
207-
]
208-
}
209193
}
210194

211195
llvm_libc_source_set("strsignalerror") {
@@ -252,36 +236,10 @@ llvm_libc_source_set("StringUtil") {
252236
]
253237
}
254238

255-
if (file_exists_in_string) {
256-
llvm_libc_source_set("compat") {
257-
functions = [
258-
"bcmp",
259-
"bcopy",
260-
"bzero",
261-
"index",
262-
"rindex",
263-
]
264-
265-
deps = [ ":swab" ]
266-
}
267-
268-
# This lives in libc/src/unistd upstream because it's declared in <unistd.h>
269-
# but it's really a compat string function, so we include it here instead.
270-
llvm_libc_source_set("swab") {
271-
dir = "unistd"
272-
functions = [ "swab" ]
273-
}
274-
}
275-
276239
# This provides an archive library of the universally safe string functions.
277240
# When built outside the "user.libc" environment, these always define only
278241
# hidden-visibility symbols and should be safe in any build environment.
279242
static_library("hermetic") {
280243
complete_static_lib = true
281244
deps = [ ":minimal-str" ]
282-
if (file_exists_in_string) {
283-
deps += [ ":compat" ]
284-
} else {
285-
deps += [ "//zircon/system/ulib/c/strings:compat" ]
286-
}
287245
}

zircon/system/ulib/c/string/file_exists.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

zircon/system/ulib/c/string/file_exists_check.gni

Lines changed: 0 additions & 10 deletions
This file was deleted.

zircon/system/ulib/c/strings/BUILD.gn

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33
# found in the LICENSE file.
44

55
import("../libc.gni")
6-
import("../string/file_exists_check.gni")
76

8-
if (!file_exists_in_string) {
9-
llvm_libc_group("strings") {
10-
deps = [
11-
":compat",
12-
":str",
13-
]
14-
}
7+
llvm_libc_source_set("strings") {
8+
functions = [
9+
"strcasecmp",
10+
"strncasecmp",
11+
]
1512

16-
llvm_libc_source_set("str") {
17-
functions = [
18-
"strcasecmp",
19-
"strncasecmp",
20-
]
21-
}
13+
deps = [ ":compat" ]
14+
}
15+
16+
llvm_libc_source_set("compat") {
17+
functions = [
18+
"bcmp",
19+
"bcopy",
20+
"bzero",
21+
"index",
22+
"rindex",
23+
]
2224

23-
llvm_libc_source_set("compat") {
24-
functions = [
25-
"bcmp",
26-
"bcopy",
27-
"bzero",
28-
"index",
29-
"rindex",
30-
]
25+
deps = [ ":swab" ]
26+
}
3127

32-
deps = [ ":swab" ]
33-
}
28+
# This lives in libc/src/unistd upstream because it's declared in <unistd.h>
29+
# but it's really a compat string function, so we include it here instead.
30+
llvm_libc_source_set("swab") {
31+
dir = "unistd"
32+
functions = [ "swab" ]
33+
}
3434

35-
# This lives in libc/src/unistd upstream because it's declared in <unistd.h>
36-
# but it's really a compat string function, so we include it here instead.
37-
llvm_libc_source_set("swab") {
38-
dir = "unistd"
39-
functions = [ "swab" ]
40-
}
35+
# This provides an archive library of the universally safe string functions.
36+
# When built outside the "user.libc" environment, these always define only
37+
# hidden-visibility symbols and should be safe in any build environment.
38+
static_library("hermetic") {
39+
complete_static_lib = true
40+
deps = [ ":compat" ]
4141
}

0 commit comments

Comments
 (0)