From c6c74d117dee5ac747ae53ce7a1e75bb2b7470e1 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 1 Dec 2021 18:06:38 +0300 Subject: Disabling SCM_CREDS usage on DragonFly BSD. DragonFly BSD supports SCM_CREDS and SCM_RIGHTS, but only the first control message is passed correctly while the second one isn't processed by the kernel. This closes #599 issue on GitHub. --- auto/sockets | 62 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) (limited to 'auto') diff --git a/auto/sockets b/auto/sockets index 1b6b4368..e6ef326d 100644 --- a/auto/sockets +++ b/auto/sockets @@ -166,51 +166,53 @@ if [ $nxt_found = no ]; then fi -nxt_feature="sockopt SO_PASSCRED" -nxt_feature_name=NXT_HAVE_SOCKOPT_SO_PASSCRED -nxt_feature_run= -nxt_feature_incs= -nxt_feature_libs= -nxt_feature_test="#define _GNU_SOURCE - #include +if [ $NXT_SYSTEM != DragonFly ]; then + nxt_feature="sockopt SO_PASSCRED" + nxt_feature_name=NXT_HAVE_SOCKOPT_SO_PASSCRED + nxt_feature_run= + nxt_feature_incs= + nxt_feature_libs= + nxt_feature_test="#define _GNU_SOURCE + #include - int main() { - return SO_PASSCRED == 0; - }" -. auto/feature + int main() { + return SO_PASSCRED == 0; + }" + . auto/feature -if [ $nxt_found = yes ]; then - nxt_feature="struct ucred" - nxt_feature_name=NXT_HAVE_UCRED + if [ $nxt_found = yes ]; then + nxt_feature="struct ucred" + nxt_feature_name=NXT_HAVE_UCRED + nxt_feature_run= + nxt_feature_incs= + nxt_feature_libs= + nxt_feature_test="#define _GNU_SOURCE + #include + #include + + int main() { + return sizeof(struct ucred); + }" + . auto/feature + fi + + + nxt_feature="struct cmsgcred" + nxt_feature_name=NXT_HAVE_MSGHDR_CMSGCRED nxt_feature_run= nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#define _GNU_SOURCE #include - #include int main() { - return sizeof(struct ucred); + return sizeof(struct cmsgcred); }" . auto/feature fi -nxt_feature="struct cmsgcred" -nxt_feature_name=NXT_HAVE_MSGHDR_CMSGCRED -nxt_feature_run= -nxt_feature_incs= -nxt_feature_libs= -nxt_feature_test="#define _GNU_SOURCE - #include - - int main() { - return sizeof(struct cmsgcred); - }" -. auto/feature - - nxt_feature="sys/filio.h" nxt_feature_name=NXT_HAVE_SYS_FILIO_H nxt_feature_run= -- cgit From 2a087fa5654954878c00edef6b07a9fe4090475f Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 3 Dec 2021 03:11:06 +0300 Subject: Printing version in "./configure" output. --- auto/os/test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'auto') diff --git a/auto/os/test b/auto/os/test index c37700a6..b7e73299 100644 --- a/auto/os/test +++ b/auto/os/test @@ -97,4 +97,5 @@ case "$NXT_SYSTEM" in esac -$echo configuring for $NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM +$echo "configuring Unit $NXT_VERSION" \ + "for $NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM" -- cgit From 1297e8a16a2fb0ccc195c0dd14b678bb2d7fc9fc Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 10 Jan 2022 16:07:31 +0300 Subject: Tests: using modules in Go. --- auto/modules/go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'auto') diff --git a/auto/modules/go b/auto/modules/go index 7324ffbe..a8596bf3 100644 --- a/auto/modules/go +++ b/auto/modules/go @@ -111,7 +111,8 @@ install: ${NXT_GO}-install ${NXT_GO}: ${NXT_GO}-install: ${NXT_GO}-install-src ${NXT_GO}-install-env - GOPATH=\$(DESTDIR)\$(GOPATH) GO111MODULE=auto ${NXT_GO} build ${NXT_GO_PKG} + cd \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG} && \ + GOPATH=\$(DESTDIR)\$(GOPATH) ${NXT_GO} build ${NXT_GO_PKG} ${NXT_GO}-install-src: install -d \$(DESTDIR)\$(NXT_GO_DST)/src/${NXT_GO_PKG} -- cgit From 0b79735b503cc0a35062799a8ac45f169f0af0f7 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Fri, 11 Mar 2022 01:59:24 +0100 Subject: Added NXT_MAYBE_UNUSED for __attribute__((__unused__)). When testing some configurations of compilers and OSes, I noticed that clang(1) 13 on Debian caused a function to be compiled but unused, and the compiler triggered a compile error. To avoid that error, use __attribute__((__unused__)). Let's call our wrapper NXT_MAYBE_UNUSED, since it describes itself more precisely than the GCC attribute name. It's also the name that C2x (likely C23) has given to the standard attribute, which is [[maybe_unused]], so it's also likely to be more readable because of that name being in ISO C. --- auto/clang | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'auto') diff --git a/auto/clang b/auto/clang index 8639457a..1a05b5a3 100644 --- a/auto/clang +++ b/auto/clang @@ -176,3 +176,21 @@ nxt_feature_test="struct s { return 1; }" . auto/feature + + +nxt_feature="GCC __attribute__ unused" +nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_UNUSED +nxt_feature_run= +nxt_feature_incs= +nxt_feature_libs= +nxt_feature_test="static void f(void) __attribute__ ((__unused__)); + + static void f(void) + { + return; + } + + int main(void) { + return 0; + }" +. auto/feature -- cgit From 60a584cfab19d6c671b4aeebf32d0b36a4bc1b77 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 10 Mar 2022 21:19:01 +0100 Subject: Workarounded Clang bug triggered by Ruby. Add -fdeclspec to NXT_RUBY_CFLAGS for Clang, if it's available. Clang incorrectly reports 1 for __has_declspec_attribute(x) in some cases, such as MacOS or Cygwin. That causes ruby code to break. ruby added -fdeclspec to their CFLAGS in 2019 to workaround this bug, since it enables __declspec() and therefore, the compiler behavior matches what it reports. Since we don't know what are all the architectures that trigger the clang bug, let's add the flag for all of them (especially since it should be harmless). Add this workaround only at the time of configuring the ruby module. This way we don't clutter the global NXT_CFLAGS with an unnecessary flag. Link: unit bug Link: ruby bug Link: LLVM bug Commit: LLVM: Add -fdeclspec Commit: ruby: Use -fdeclspec <0958e19ffb047781fe1506760c7cbd8d7fe74e57> --- auto/modules/ruby | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'auto') diff --git a/auto/modules/ruby b/auto/modules/ruby index 68324b44..dbedfd72 100644 --- a/auto/modules/ruby +++ b/auto/modules/ruby @@ -56,6 +56,7 @@ nxt_found=no if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then + NXT_RUBY_CFLAGS= NXT_RUBY_RUBYHDRDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubyhdrdir"]'` NXT_RUBY_ARCHHDRDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubyarchhdrdir"]'` NXT_RUBY_SITEDIR=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["sitedir"]'` @@ -72,6 +73,31 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then NXT_RUBY_LIBPATH=`$NXT_RUBY -rrbconfig -e 'print RbConfig::CONFIG["libdir"]'` NXT_RUBY_LIBS="-l$NXT_RUBY_LIBNAME $NXT_RUBY_LIBSCONF" + if [ $NXT_CC_NAME = clang ]; then + # Workaround Clang bug + nxt_feature="-fdeclspec" + nxt_feature_name= + nxt_feature_run= + nxt_feature_incs="-fdeclspec" + nxt_feature_libs= + nxt_feature_test="#include + + __declspec(noreturn) static void f(void); + + static void f(void) { + exit(0); + } + + int main(void) { + f(); + }" + . auto/feature + + if [ $nxt_found = yes ]; then + NXT_RUBY_CFLAGS="$NXT_RUBY_CFLAGS -fdeclspec" + fi + fi + nxt_feature="Ruby library" nxt_feature_name="" nxt_feature_run=value @@ -205,7 +231,7 @@ for nxt_src in $NXT_RUBY_MODULE_SRCS; do $NXT_BUILD_DIR/$nxt_obj: $nxt_src $NXT_VERSION_H mkdir -p $NXT_BUILD_DIR/src/ruby - \$(CC) -c \$(CFLAGS) -DNXT_RUBY_MOUNTS_H=\"$NXT_RUBY_MOUNTS_HEADER\" \\ + \$(CC) -c \$(CFLAGS) $NXT_RUBY_CFLAGS -DNXT_RUBY_MOUNTS_H=\"$NXT_RUBY_MOUNTS_HEADER\" \\ \$(NXT_INCS) $NXT_RUBY_INCPATH \\ $nxt_dep_flags \\ -o $NXT_BUILD_DIR/$nxt_obj $nxt_src -- cgit