[PATCH 05/18] Added auto/cflags, with a test for -fno-gnu89-inline.

Alejandro Colomar alx.manpages at gmail.com
Thu Jun 2 18:04:59 UTC 2022


Add -fno-gnu89-inline, to make sure we don't use the broken GNU
inline.  The default is C99 inline nowadays, which is the desired
one, but this flags helps make sure we don't use it accidentally.

See also: <http://www.greenend.org.uk/rjk/tech/inline.html>
---
 auto/cflags | 23 +++++++++++++++++++++++
 configure   |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 auto/cflags

diff --git a/auto/cflags b/auto/cflags
new file mode 100644
index 00000000..b192ba4
--- /dev/null
+++ b/auto/cflags
@@ -0,0 +1,23 @@
+
+
+# C compiler flags
+
+
+nxt_feature='-fno-gnu89-inline'
+nxt_feature_name=
+nxt_feature_run=
+nxt_feature_incs='-fno-gnu89-inline'
+nxt_feature_libs=
+nxt_feature_test='inline void f(void) {
+                      return;
+                  }
+
+                  int main(void) {
+                      f();
+                  }'
+
+. auto/feature
+
+if [ $nxt_found = yes ]; then
+    NXT_CFLAGS="$NXT_CFLAGS -fno-gnu89-inline"
+fi
diff --git a/configure b/configure
index bc21e57..4a12a6f 100755
--- a/configure
+++ b/configure
@@ -114,6 +114,7 @@ fi
 
 NXT_LIBRT=
 
+. auto/cflags
 . auto/types
 . auto/clang
 . auto/atomic
-- 
2.36.1



More information about the unit mailing list