• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# © 2021 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
3
4# This Bazel build file defines a target representing the binary executable
5# `genuca`, which is used for generating ICU root collation data files.
6
7load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
8
9package(
10    default_visibility = ["//visibility:public"],
11)
12
13cc_binary(
14    name = "genuca",
15    srcs = glob([
16        "*.cpp",
17        "*.h",   # cannot have hdrs section in cc_binary
18    ]),
19    deps = [
20        "//icu4c/source/common:headers",
21        "//icu4c/source/common:platform",
22        "//icu4c/source/i18n:collation_builder",
23        "//icu4c/source/i18n:headers",
24        "//icu4c/source/tools/toolutil:collationinfo",
25        "//icu4c/source/tools/toolutil:toolutil",
26        "//icu4c/source/tools/toolutil:unewdata",
27        "//icu4c/source/tools/toolutil:uoptions",
28        "//icu4c/source/tools/toolutil:uparse",
29        "//icu4c/source/tools/toolutil:writesrc",
30    ],
31    # Markus 2021-06-16:
32    # The pthread library is not linked in automatically.
33    # See https://docs.bazel.build/versions/main/cpp-use-cases.html
34    # When pthread is absent, then we get runtime errors instead of compile/link errors.
35    # See https://stackoverflow.com/questions/51584960/stdcall-once-throws-stdsystem-error-unknown-error-1
36    #
37    # My first genuca build crashed with
38    #   terminate called after throwing an instance of 'std::system_error'
39    #   what():  Unknown error -1
40    #
41    #   Program received signal SIGABRT, Aborted.
42    #   ...
43    #   #4  0x00007ffff7e809d1 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
44    #   #5  0x00007ffff7e80c65 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
45    #   #6  0x00007ffff7e78458 in std::__throw_system_error(int) () from /lib/x86_64-linux-gnu/libstdc++.so.6
46    #   #7  0x0000555555601c75 in std::call_once<void (&)()> (__once=..., __f=@0x55555560156c: {void (void)} 0x55555560156c <icu_70::umtx_init()>)
47    #       at /usr/include/c++/10/mutex:743
48    #   #8  0x00005555556017ca in icu_70::umtx_initImplPreInit (uio=...) at icu4c/source/common/umutex.cpp:146
49    #   #9  0x0000555555592236 in icu_70::umtx_initOnce (uio=..., fp=0x5555555e0716 <icu_70::initNFCSingleton(UErrorCode&)>,
50    #   errCode=@0x7fffffffd738: U_ZERO_ERROR) at icu4c/source/common/umutex.h:143
51    linkopts = ["-pthread"],
52)
53