aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2023-08-03 11:06:49 -0700
committerElliott Hughes <enh@google.com>2023-08-03 11:06:49 -0700
commitf123bad00c455f602e7e26e2d6f5ec58ab2754a7 (patch)
tree7a29046e71d52115ccdac85aff38a86ebc513b0b
parent4b8353eda71232d524596431859b4e471fb5f6ef (diff)
downloadgptfdisk-f123bad00c455f602e7e26e2d6f5ec58ab2754a7.tar.gz
Build sgdisk with _FILE_OFFSET_BITS=64.
Since https://sourceforge.net/p/gptfdisk/code/ci/7dfa8984f5a30f313d8675ff6097c8592d636d10/ upstream assumes that it's being built with _FILE_OFFSET_BITS=64. This is true for 64-bit Android, but not for 32-bit Android. We can't change that globally because it would be a source-incompatible ABI change (_all_ code that uses off_t or an associated function would have to be recompiled with _FILE_OFFSET_BITS=64, including code not in our tree). We can safely make this change here, though, because the "library" is actually just to reduce duplication between the sgdisk binary and the fuzzer. We could probably get rid of the library completely and just rely on cc_defaults or a filegroup for this, but the less invasive change is just to add visibility clauses (and a comment!) to ensure that no-one starts exporting anything from here (even though the GPL license makes that unlikely anyway). While I'm here, we can remove the Darwin special case (which was a bit weird, tbh, given that Darwin has _always and only_ had a 64-bit off_t). Bug: https://issuetracker.google.com/294327337 Test: mm for both a 32-bit lunch and a 64-bit lunch Change-Id: Icc740cbcf2a0e8747876d1e725f5439c5795a9b2
-rw-r--r--Android.bp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Android.bp b/Android.bp
index ec1c354..c1a916a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -37,15 +37,14 @@ cc_defaults {
"-Wno-pragma-pack",
"-Werror",
"-fPIC",
+ "-D_FILE_OFFSET_BITS=64",
],
- target: {
- darwin: {
- cflags: [
- "-D_FILE_OFFSET_BITS=64",
- "-Doff64_t=off_t",
- ],
- },
- },
+ // This project requires _FILE_OFFSET_BITS=64, which isn't globally
+ // true for 32-bit Android builds. It's safe here because the libraries
+ // built by this build file aren't exported. If that changes, you'll
+ // need to come up with a plan (probably either upstreaming better 32-bit
+ // support, or waiting until we no longer support 32-bit either).
+ visibility: [":__subpackages__"],
}
cc_binary {