summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2018-02-26 13:54:20 -0500
committerTheodore Ts'o <tytso@mit.edu>2018-02-26 13:54:20 -0500
commitc19b18f84b67681da7f0b778d25830af67a888f3 (patch)
tree8e688f5708472c4954e8ba4b423f0b0e8c1322b3
parent33b80078dbc2294339aa81b752ee3ebf118aaf5b (diff)
downloade2fsprogs-c19b18f84b67681da7f0b778d25830af67a888f3.tar.gz
AOSP: use e2fsprogs-defaults for ccflags
From AOSP commit: 2002d7f1fc: Use -Werror in external/e2fsprogs ... which got reverted and reapplied in a confusing way. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--contrib/Android.bp2
-rw-r--r--contrib/android/Android.bp4
-rw-r--r--contrib/android/Android.mk2
-rw-r--r--debugfs/Android.bp5
-rw-r--r--e2fsck/Android.bp6
-rw-r--r--lib/blkid/Android.bp6
-rw-r--r--lib/e2p/Android.bp7
-rw-r--r--lib/et/Android.bp5
-rw-r--r--lib/ext2fs/Android.bp9
-rw-r--r--lib/ss/Android.bp6
-rw-r--r--lib/support/Android.bp12
-rw-r--r--lib/uuid/Android.bp5
-rw-r--r--misc/Android.bp33
-rw-r--r--misc/Android.mk2
-rw-r--r--resize/Android.bp2
15 files changed, 48 insertions, 58 deletions
diff --git a/contrib/Android.bp b/contrib/Android.bp
index eba15c22..8bde657f 100644
--- a/contrib/Android.bp
+++ b/contrib/Android.bp
@@ -8,9 +8,9 @@ subdirs = ["android"]
cc_binary {
name: "add_ext4_encrypt",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: ["add_ext4_encrypt.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2fs",
"libext2_com_err",
diff --git a/contrib/android/Android.bp b/contrib/android/Android.bp
index a78d483a..f7fbf666 100644
--- a/contrib/android/Android.bp
+++ b/contrib/android/Android.bp
@@ -6,6 +6,7 @@
cc_binary {
name: "e2fsdroid",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"e2fsdroid.c",
@@ -17,7 +18,6 @@ cc_binary {
"basefs_allocator.c",
"hashmap.c",
],
- cflags: ["-W", "-Wall"],
target: {
host: {
static_libs: [
@@ -57,9 +57,9 @@ cc_binary {
cc_binary {
name: "ext2simg",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: ["ext2simg.c"],
- cflags: ["-W", "-Wall"],
shared_libs: [
"libext2fs",
"libext2_com_err",
diff --git a/contrib/android/Android.mk b/contrib/android/Android.mk
index 98ce01d8..bdfdece5 100644
--- a/contrib/android/Android.mk
+++ b/contrib/android/Android.mk
@@ -12,7 +12,7 @@ e2fsdroid_src_files := \
basefs_allocator.c \
hashmap.c \
-e2fsdroid_cflags := -W -Wall
+e2fsdroid_cflags := -W -Wall -Werror -Wno-error=macro-redefined
e2fsdroid_static_libraries := \
libext2_com_err \
diff --git a/debugfs/Android.bp b/debugfs/Android.bp
index adaa6354..2a7d6222 100644
--- a/debugfs/Android.bp
+++ b/debugfs/Android.bp
@@ -5,6 +5,7 @@
cc_defaults {
name: "debugfs-defaults",
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"debug_cmds.c",
"debugfs.c",
@@ -31,9 +32,7 @@ cc_defaults {
"do_journal.c",
],
cflags: [
- "-W",
- "-Wall",
- "-Wno-macro-redefined",
+ "-Wno-unused-variable",
"-fno-strict-aliasing",
"-DDEBUGFS",
],
diff --git a/e2fsck/Android.bp b/e2fsck/Android.bp
index 3eb86595..475cea12 100644
--- a/e2fsck/Android.bp
+++ b/e2fsck/Android.bp
@@ -5,6 +5,7 @@
cc_defaults {
name: "e2fsck-defaults",
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"e2fsck.c",
"super.c",
@@ -34,7 +35,10 @@ cc_defaults {
"readahead.c",
"extents.c",
],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined", "-fno-strict-aliasing"],
+ cflags: [
+ "-Wno-sign-compare",
+ "-fno-strict-aliasing"
+ ],
}
e2fsck_libs = [
diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp
index 2455d390..225716cd 100644
--- a/lib/blkid/Android.bp
+++ b/lib/blkid/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2_blkid",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"cache.c",
"dev.c",
@@ -35,8 +36,9 @@ cc_library {
},
cflags: [
- "-W",
- "-Wall",
+ "-Wno-error=attributes",
+ "-Wno-error=pointer-sign",
+ "-Wno-unused-parameter",
"-fno-strict-aliasing",
],
diff --git a/lib/e2p/Android.bp b/lib/e2p/Android.bp
index 5ce3e020..21089d7b 100644
--- a/lib/e2p/Android.bp
+++ b/lib/e2p/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2_e2p",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"feature.c",
"fgetflags.c",
@@ -29,11 +30,7 @@ cc_library {
"percent.c",
],
- cflags: [
- "-W",
- "-Wall",
- "-Wno-macro-redefined",
- ],
+ cflags: ["-Wno-error=attributes"],
target: {
windows: {
diff --git a/lib/et/Android.bp b/lib/et/Android.bp
index 572c805f..670d8ee4 100644
--- a/lib/et/Android.bp
+++ b/lib/et/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2_com_err",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"error_message.c",
"et_name.c",
@@ -12,10 +13,6 @@ cc_library {
"com_right.c",
],
- cflags: [
- "-W",
- "-Wall",
- ],
target: {
windows: {
enabled: true,
diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp
index 8f389ec7..427d93be 100644
--- a/lib/ext2fs/Android.bp
+++ b/lib/ext2fs/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2fs",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"ext2_err.c",
"alloc.c",
@@ -94,12 +95,7 @@ cc_library {
whole_static_libs: [
"libext2_com_err"
],
- cflags: [
- "-W",
- "-Wall",
- "-Wno-unused-parameter",
- "-Wno-macro-redefined",
- ],
+ cflags: ["-Wno-unused-parameter"],
target: {
host: {
// Consider removing this library as a whole for the host. It is not
@@ -116,6 +112,7 @@ cc_library {
enabled: true,
include_dirs: [ "external/e2fsprogs/include/mingw" ],
cflags: [
+ "-Wno-error=cpp",
"-Wno-format",
"-Wno-unused-variable",
],
diff --git a/lib/ss/Android.bp b/lib/ss/Android.bp
index 06925d73..09332512 100644
--- a/lib/ss/Android.bp
+++ b/lib/ss/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2_ss",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"ss_err.c",
"std_rqs.c",
@@ -22,11 +23,6 @@ cc_library {
"get_readline.c",
],
shared_libs: ["libext2_com_err"],
- cflags: [
- "-W",
- "-Wall",
- ],
-
header_libs: ["libext2-headers"],
export_include_dirs: ["."],
export_header_lib_headers: ["libext2-headers"],
diff --git a/lib/support/Android.bp b/lib/support/Android.bp
index 4a89b8f3..0ddd0793 100644
--- a/lib/support/Android.bp
+++ b/lib/support/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2_quota",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"dict.c",
"mkquota.c",
@@ -27,12 +28,6 @@ cc_library {
},
},
- cflags: [
- "-W",
- "-Wall",
- "-Wno-macro-redefined",
- ],
-
header_libs: ["libext2-headers"],
export_include_dirs: ["."],
export_header_lib_headers: ["libext2-headers"],
@@ -42,15 +37,12 @@ cc_library_shared {
name: "libext2_profile",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"prof_err.c",
"profile.c",
],
- cflags = [
- "-W",
- "-Wall",
- ],
shared_libs: ["libext2_com_err"],
header_libs: ["libext2-headers"],
diff --git a/lib/uuid/Android.bp b/lib/uuid/Android.bp
index b6664f99..15c12921 100644
--- a/lib/uuid/Android.bp
+++ b/lib/uuid/Android.bp
@@ -4,6 +4,7 @@ cc_library {
name: "libext2_uuid",
host_supported: true,
unique_host_soname: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"clear.c",
"compare.c",
@@ -17,13 +18,13 @@ cc_library {
"uuid_time.c",
],
cflags: [
- "-W",
- "-Wall",
"-Wno-unused-function",
"-Wno-unused-parameter",
],
target: {
windows: {
+ // Cannot suppress the _WIN32_WINNT redefined warning.
+ cflags: ["-Wno-error"],
include_dirs: [ "external/e2fsprogs/include/mingw" ],
enabled: true
},
diff --git a/misc/Android.bp b/misc/Android.bp
index 7a108179..e73150f8 100644
--- a/misc/Android.bp
+++ b/misc/Android.bp
@@ -5,6 +5,7 @@
cc_library {
name: "libext2_misc",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
target: {
windows: {
@@ -17,7 +18,7 @@ cc_library {
srcs: [
"create_inode.c",
],
- cflags: ["-W", "-Wall"],
+ cflags: ["-Wno-error=format-extra-args"],
shared_libs: [
"libext2_quota",
"libext2fs",
@@ -32,6 +33,7 @@ cc_library {
cc_binary {
name: "mke2fs",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"mke2fs.c",
@@ -66,7 +68,14 @@ cc_binary {
},
windows: {
include_dirs: [ "external/e2fsprogs/include/mingw" ],
- cflags: ["-D_POSIX", "-D__USE_MINGW_ALARM"],
+ cflags: [
+ "-D_POSIX",
+ "-D__USE_MINGW_ALARM",
+ // mke2fs.c has a warning from gcc which cannot be suppressed:
+ // passing argument 3 of 'ext2fs_get_device_size' from
+ // incompatible pointer type
+ "-Wno-error"
+ ],
ldflags: ["-static"],
host_ldlibs: ["-lws2_32"],
enabled: true
@@ -96,16 +105,12 @@ cc_binary {
cc_defaults {
name: "tune2fs-defaults",
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"tune2fs.c",
"util.c",
],
- cflags: [
- "-W",
- "-Wall",
- "-DNO_RECOVERY",
- "-Wno-macro-redefined",
- ],
+ cflags: ["-DNO_RECOVERY"],
include_dirs: ["external/e2fsprogs/e2fsck"],
}
@@ -149,9 +154,9 @@ cc_library_static {
cc_binary {
name: "badblocks",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: ["badblocks.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2fs",
"libext2_com_err",
@@ -168,9 +173,9 @@ cc_binary {
cc_binary {
name: "chattr",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: ["chattr.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2_com_err",
"libext2_e2p",
@@ -184,7 +189,7 @@ cc_binary {
cc_defaults {
name: "lsattr-defaults",
srcs: ["lsattr.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
+ defaults: ["e2fsprogs-defaults"],
}
lsattr_libs = [
@@ -214,9 +219,9 @@ cc_binary {
cc_binary {
name: "blkid",
+ defaults: ["e2fsprogs-defaults"],
srcs: ["blkid.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2fs",
"libext2_blkid",
@@ -232,9 +237,9 @@ cc_binary {
cc_binary {
name: "e4crypt",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: ["e4crypt.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2fs",
"libext2_uuid",
@@ -254,9 +259,9 @@ cc_binary {
cc_binary {
name: "e2image",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: ["e2image.c"],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2fs",
"libext2_blkid",
diff --git a/misc/Android.mk b/misc/Android.mk
index d3bb8207..c9d07353 100644
--- a/misc/Android.mk
+++ b/misc/Android.mk
@@ -12,7 +12,7 @@ mke2fs_src_files := \
mke2fs_c_includes := \
external/e2fsprogs/e2fsck
-mke2fs_cflags := -W -Wall -Wno-macro-redefined
+mke2fs_cflags := -W -Wall -Werror -Wno-macro-redefined
mke2fs_static_libraries := \
libext2_blkid \
diff --git a/resize/Android.bp b/resize/Android.bp
index dcdf6591..d55e24c2 100644
--- a/resize/Android.bp
+++ b/resize/Android.bp
@@ -3,6 +3,7 @@
cc_binary {
name: "resize2fs",
host_supported: true,
+ defaults: ["e2fsprogs-defaults"],
srcs: [
"extent.c",
@@ -12,7 +13,6 @@ cc_binary {
"sim_progress.c",
"resource_track.c",
],
- cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
shared_libs: [
"libext2fs",
"libext2_com_err",