Skip to content

Commit

Permalink
Merge pull request redpanda-data#20 from dotnwat/pciaccess-warnings
Browse files Browse the repository at this point in the history
Pciaccess warnings
  • Loading branch information
dotnwat committed Jul 2, 2024
2 parents 107ed92 + dbadf9b commit 95a8172
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 23 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ build:release --copt -mllvm --copt -inline-threshold=2500
build:release --linkopt=-flto

build --@seastar//:openssl=True
build --keep_going

try-import %workspace%/user.bazelrc
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions bazel/internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@ scripts in the `bazel/` directory.
"""

def redpanda_copts():
"""
Add common options to redpanda targets.
Returns:
Options to be added to target.
"""

# TODO Bazel prefers -iquote "path" style includes in many cases. However,
# our source tree uses bracket <path> style for dependencies. We need a way
# to bridge this gap until we decide to fully switch over to Bazel at which
# point this hack can be removed. Many deps lists in the tree will probably
# need to be updated to include abseil explicitly when this is removed.
copts = []
copts.append("-Iexternal/abseil-cpp~")

copts.append("-Werror")
copts.append("-Wall")
copts.append("-Wextra")
copts.append("-Wno-missing-field-initializers")
copts.append("-Wimplicit-fallthrough")

return copts
6 changes: 3 additions & 3 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def data_dependency():
http_archive(
name = "libpciaccess",
build_file = "//bazel/thirdparty:libpciaccess.BUILD",
sha256 = "9938b18509553452c6e13f79e16cbaffec9ea67119aa2de5d75e83c4f67ff400",
strip_prefix = "libpciaccess-libpciaccess-0.16",
url = "https://vectorized-public.s3.amazonaws.com/dependencies/libpciaccess-0.16.tar.bz2",
sha256 = "d0d0d53c2085d21ab37ae5989e55a3de13d4d80dc2c0a8d5c77154ea70f4783c",
strip_prefix = "libpciaccess-2ec2576cabefef1eaa5dd9307c97de2e887fc347",
url = "https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/archive/2ec2576cabefef1eaa5dd9307c97de2e887fc347/libpciaccess-2ec2576cabefef1eaa5dd9307c97de2e887fc347.tar.gz",
)

http_archive(
Expand Down
81 changes: 65 additions & 16 deletions bazel/thirdparty/libpciaccess.BUILD
Original file line number Diff line number Diff line change
@@ -1,22 +1,71 @@
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")

filegroup(
name = "srcs",
srcs = glob(["**"]),
)

configure_make(
cc_library(
name = "libpciaccess",
autoreconf = True,
autoreconf_options = ["-ivf"],
configure_in_place = True,
configure_options = [
"--disable-shared",
"--enable-static",
srcs = [
"src/common_bridge.c",
"src/common_capability.c",
"src/common_device_name.c",
"src/common_init.c",
"src/common_interface.c",
"src/common_io.c",
"src/common_iterator.c",
"src/common_map.c",
"src/linux_devmem.h",
"src/pciaccess_private.h",
] + select({
"@platforms//os:linux": [
"src/common_vgaarb.c",
"src/linux_devmem.c",
"src/linux_sysfs.c",
],
"//conditions:default": [],
}),
hdrs = [
"include/pciaccess.h",
],
copts = [
"-Wpointer-arith",
"-Wmissing-declarations",
"-Wformat=2",
"-Wstrict-prototypes",
"-Wmissing-prototypes",
"-Wnested-externs",
"-Wbad-function-cast",
"-Wold-style-definition",
"-Wdeclaration-after-statement",
"-Wunused",
"-Wuninitialized",
"-Wshadow",
"-Wmissing-noreturn",
"-Wmissing-format-attribute",
"-Wredundant-decls",
"-Werror=implicit",
"-Werror=nonnull",
"-Werror=init-self",
"-Werror=main",
"-Werror=missing-braces",
"-Werror=sequence-point",
"-Werror=return-type",
"-Werror=trigraphs",
"-Werror=array-bounds",
"-Werror=write-strings",
"-Werror=address",
"-Werror=int-to-pointer-cast",
],
lib_source = ":srcs",
out_static_libs = ["libpciaccess.a"],
local_defines = [
'PCIIDS_PATH=\\"/usr/share/hwdata\\"',
"HAVE_ZLIB=1",
"HAVE_MTRR=1",
"HAVE_ERR_H=1",
"HAVE_INTTYPES_H=1",
"HAVE_STDINT_H=1",
"HAVE_STRINGS_H=1",
"HAVE_STRING_H=1",
],
strip_include_prefix = "include",
visibility = [
"//visibility:public",
],
deps = [
"@zlib",
],
)

0 comments on commit 95a8172

Please sign in to comment.