-
Notifications
You must be signed in to change notification settings - Fork 574
libdwarf@2.2.0 #6287
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
Open
hugooole
wants to merge
1
commit into
bazelbuild:main
Choose a base branch
from
hugooole:zhiguo/libdwarf@2.2.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+175
−1
Open
libdwarf@2.2.0 #6287
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| module( | ||
| name = "libdwarf", | ||
| version = "2.2.0", | ||
| bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory | ||
| compatibility_level = 0, | ||
| ) | ||
|
|
||
| bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
| bazel_dep(name = "platforms", version = "0.0.11") | ||
| bazel_dep(name = "rules_cc", version = "0.1.1") | ||
| bazel_dep(name = "zlib", version = "1.3.1.bcr.5") | ||
| bazel_dep(name = "zstd", version = "1.5.7") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| load("@bazel_skylib//rules:expand_template.bzl", "expand_template") | ||
| load("@rules_cc//cc:defs.bzl", "cc_library") | ||
| load("//:gen_test_targets.bzl", "gen_test_targets") | ||
|
|
||
| expand_template( | ||
| name = "config_h", | ||
| out = "src/lib/libdwarf/config.h", | ||
| # Enable features assuming we are compiling for a modern posix system. | ||
| substitutions = { | ||
| "#cmakedefine AC_APPLE_UNIVERSAL_BUILD 1": "", | ||
| "#cmakedefine CRAY_STACKSEG_END 1": "", | ||
| "#cmakedefine HAVE_DLFCN_H 1": "#define HAVE_DLFCN_H 1", | ||
| "#cmakedefine HAVE_FCNTL_H 1": "#define HAVE_FCNTL_H 1", | ||
| "#cmakedefine WORDS_BIGENDIAN 1": "", | ||
| "#cmakedefine HAVE_STDINT_H 1": "#define HAVE_STDINT_H 1", | ||
| "#cmakedefine HAVE_SYS_STAT_H 1": "#define HAVE_SYS_STAT_H 1", | ||
| "#cmakedefine HAVE_SYS_TYPES_H 1": "#define HAVE_SYS_TYPES_H 1", | ||
| "#cmakedefine HAVE_FULL_MMAP 1": "#define HAVE_FULL_MMAP 1", | ||
| "#cmakedefine uintptr_t ${uintptr_t}": "", | ||
| "#cmakedefine intptr_t ${intptr_t}": "", | ||
| "#cmakedefine HAVE_UNISTD_H 1": "#define HAVE_UNISTD_H 1", | ||
| "#cmakedefine HAVE_ZLIB 1": "#define HAVE_ZLIB 1", | ||
| "#cmakedefine HAVE_ZLIB_H 1": "#define HAVE_ZLIB_H 1", | ||
| "#cmakedefine HAVE_ZSTD 1": "#define HAVE_ZSTD 1", | ||
| "#cmakedefine HAVE_ZSTD_H 1": "#define HAVE_ZSTD_H 1", | ||
| "#cmakedefine LT_OBJDIR 1": "", | ||
| # PACKAGE_VERSION needs to be defined for the code to compile, but I | ||
| # don't really want to put the actual version in here since people are | ||
| # going to forget to update it, so just set it to empty string. | ||
| "#define PACKAGE_VERSION \"@PROJECT_VERSION@\"": "#define PACKAGE_VERSION \"\"", | ||
| "#define PACKAGE_BUGREPORT \"@PACKAGE_BUGREPORT@\"": "", | ||
| "#define PACKAGE_NAME \"@PROJECT_NAME@\"": "", | ||
| "#define PACKAGE_STRING \"@PACKAGE_STRING@\"": "", | ||
| "#cmakedefine PACKAGE_TARNAME": "", | ||
| "#define PACKAGE_URL \"@PROJECT_HOMEPAGE_URL@\"": "", | ||
| "#cmakedefine STACK_DIRECTION": "", | ||
| "#cmakedefine STDC_HEADERS 1": "#define STDC_HEADERS 1", | ||
| "#cmakedefine PACKAGE_VERSION ${PACKAGE_VERSION}": "", | ||
| # Must be substituted after all defines with a PACKAGE_* prefix, | ||
| # otherwise it will replace part of those defines. | ||
| "#cmakedefine PACKAGE": "", | ||
| "#cmakedefine HAVE_INTTYPES_H 1": "#define HAVE_INTTYPES_H 1", | ||
| "#cmakedefine HAVE_STDDEF_H 1": "#define HAVE_STDDEF_H 1", | ||
| "#cmakedefine HAVE_STDAFX_H 1": "#define HAVE_STDAFX_H 1", | ||
| } | select({ | ||
| "@platforms//os:macos": {"#cmakedefine HAVE_MALLOC_H 1": ""}, | ||
| "//conditions:default": {"#cmakedefine HAVE_MALLOC_H 1": "#define HAVE_MALLOC_H 1"}, | ||
| }), | ||
| template = "cmake/config.h.in", | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "dwarf", | ||
| srcs = [":config_h"] + glob( | ||
| [ | ||
| "src/lib/libdwarf/*.c", | ||
| "src/lib/libdwarfp/*.c", | ||
| ], | ||
| ), | ||
| hdrs = glob( | ||
| [ | ||
| "src/lib/libdwarf/*.h", | ||
| "src/lib/libdwarfp/*.h", | ||
| ], | ||
| ), | ||
| includes = [ | ||
| "src/lib", | ||
| "src/lib/libdwarf", | ||
| "src/lib/libdwarfp", | ||
| ], | ||
| deps = [ | ||
| "@zlib", | ||
| "@zstd", | ||
| ], | ||
| ) | ||
|
|
||
| alias( | ||
| name = "libdwarf", | ||
| actual = ":dwarf", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| cc_library( | ||
| name = "dwarfdump", | ||
| # Testonly for now as this only exists for the tests to run. Ideally we also | ||
| # have a cc_binary for dwarfdump, since it's a binary, but we can add that | ||
| # if somebody actually needs it. | ||
| testonly = True, | ||
| srcs = glob(["src/bin/dwarfdump/*.c"]), | ||
| hdrs = glob( | ||
| [ | ||
| "src/bin/dwarfdump/*.h", | ||
| "src/bin/dwarfdump/*.c", | ||
| ], | ||
| ), | ||
| includes = ["src/bin/dwarfdump"], | ||
| deps = [":dwarf"], | ||
| ) | ||
|
|
||
| # Generates a good chunk of the C tests, which should be good enough to verify | ||
| # this has been Bazelified correctly. There are some Python tests and some tests | ||
| # that don't start with test_* that are not run. | ||
| gen_test_targets( | ||
| name = "gen_dwarf_test_targets", | ||
| cc_srcs = glob( | ||
| ["test/test_*.c"], | ||
| exclude = [ | ||
| # These tests require an env var to be set to the root of this lib. | ||
| # Probably not worth getting it to work. | ||
| "test/test_errmsglist.c", | ||
| "test/test_lname.c", | ||
| ], | ||
| ), | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../MODULE.bazel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| def gen_test_targets(name, cc_srcs): | ||
| """Generates a cc_test target for each source file. | ||
|
|
||
| Args: | ||
| name: name of this macro (unused) | ||
| cc_srcs: test files to generate cc_test targets for | ||
| """ | ||
|
|
||
| for src in cc_srcs: | ||
| name = src.removeprefix("test/test_").removesuffix(".c").replace("/", "_") + "_test" | ||
| native.cc_test( | ||
| name = name, | ||
| srcs = [src], | ||
| deps = [ | ||
| ":dwarf", | ||
| ":dwarfdump", | ||
| ], | ||
| local_defines = ["TESTING"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| matrix: | ||
| platform: | ||
| - debian11 | ||
| - ubuntu2004 | ||
| - ubuntu2204 | ||
| - ubuntu2404 | ||
| - macos | ||
| - macos_arm64 | ||
| bazel: [7.x, 8.x, rolling] | ||
| tasks: | ||
| verify_targets_unix: | ||
| platform: ${{ platform }} | ||
| bazel: ${{ bazel }} | ||
| build_targets: | ||
| - "@libdwarf//..." | ||
| test_targets: | ||
| - "@libdwarf//..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "url": "https://github.com/davea42/libdwarf-code/releases/download/v2.2.0/libdwarf-2.2.0.tar.xz", | ||
| "strip_prefix": "libdwarf-2.2.0", | ||
| "overlay": { | ||
| "BUILD.bazel": "sha256-mtbF8506r7dbNZspbdxunhUqvBeRLzXiCFr09EJOcDo=", | ||
| "MODULE.bazel": "sha256-0m5KSzS7DImRuGaxHf5Knrf9u+Rb+xwB6bIHvjsaLk8=", | ||
| "gen_test_targets.bzl": "sha256-T2JhSlGZ3HVpRihfsZuskM8TL+ozfMOWKl54pgCeQAQ=" | ||
| }, | ||
| "integrity": "sha256-VMCru+tBkL0bq7XShXTSsgwjCTQ+x2TMfKYR5SfuSkI=" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,8 @@ | |
| ], | ||
| "versions": [ | ||
| "0.12.0", | ||
| "0.12.0.bcr.1" | ||
| "0.12.0.bcr.1", | ||
| "2.2.0" | ||
| ], | ||
| "yanked_versions": {} | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source files (
.c) should not be included in thehdrsattribute of acc_library. Thehdrsattribute is for header files that are part of the library's public interface. Including source files can lead to multiple definition errors and unnecessarily exposes implementation details. These source files are already correctly listed in thesrcsattribute.