Skip to content
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

Bump gcc version and sysroot #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions examples/rrdtool/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")

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

# TODO(sp): Use -fdata-sections -ffunction-sections + -Wl,--gc-sections (plus
# perhaps -Wl,--print-gc-sections)
configure_make(
name = "rrdtool",
args = ["-j6"],
configure_options = [
"--disable-docs",
"--disable-examples",
"--disable-libbdi",
"--disable-libwrap",
"--disable-lua",
"--disable-perl",
"--disable-python",
"--disable-ruby",
"--disable-rrdcaches",
"--disable-rrdcgi",
"--disable-tcl",
"--with-systemdsystemunitdir=no",
# https://github.com/bazelbuild/rules_foreign_cc/issues/239
"CFLAGS='-Dredacted=\"redacted\"'",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that doesn't append but replaces the CFLAGS.
However, Bazel passes the include directories to the compiler with CFLAGS=-isystem .... Replacing CFLAGS means no header is found and configure fails.

],
copts = [
"-g",
"-O2",
"-D_GNU_SOURCE",
"-fno-strict-aliasing",
"-std=gnu99",
"-fPIC",
"-Wno-format-truncation",
"-Wno-implicit-fallthrough",
"-Wno-stringop-truncation",
],
lib_source = "@rrdtool//:srcs",
lib_name = "rrdtool",
out_binaries = [
"rrdcached",
"rrdcreate",
"rrdinfo",
"rrdtool",
"rrdupdate",
],
out_data_dirs = ["share"],
out_shared_libs = [
"librrd.so",
"librrd.so.8",
"librrd.so.8.2.1",
],
out_static_libs = ["librrd.a"],
visibility = ["//visibility:public"],
)
9 changes: 9 additions & 0 deletions internal.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ def internal_dependencies():
url = "https://www.openssl.org/source/openssl-1.1.1n.tar.gz",
)

maybe(
http_archive,
name = "rrdtool",
build_file_content = _ALL_SRCS,
sha256 = "a199faeb7eff7cafc46fac253e682d833d08932f3db93a550a4a5af180ca58db",
strip_prefix = "rrdtool-1.7.2",
url = "https://github.com/oetiker/rrdtool-1.x/releases/download/v1.7.2/rrdtool-1.7.2.tar.gz",
)

maybe(
http_archive,
name = "lapack",
Expand Down