Andrew Clayton
f8b892e1fa
Fixed the build on MacOS (and others).
...
@alejandro-colomar reported that the build was broken on MacOS
cc -o build/unitd -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g \
build/src/nxt_main.o build/libnxt.a \
\
\
-L/usr/local/Cellar/pcre2/10.40/lib -lpcre2-8
Undefined symbols for architecture x86_64:
"_nxt_fs_mkdir_parent", referenced from:
_nxt_runtime_pid_file_create in libnxt.a(nxt_runtime.o)
_nxt_runtime_controller_socket in libnxt.a(nxt_controller.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [build/unitd] Error 1
This was due to commit 57fc920 ("Socket: Created control socket & pid file
directories.").
This happened because this commit introduced the usage of
nxt_fs_mkdir_parent() in core code which uses nxt_fs_mkdir(), both of
these are defined in src/nxt_fs.c. It turns out however that this file
doesn't get built on MacOS (or any system that isn't Linux or that
lacks a FreeBSD compatible nmount(2) system call) due to the following
In auto/sources we have
if [ $NXT_HAVE_ROOTFS = YES ]; then
NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_fs.c"
fi
NXT_HAVE_ROOTFS is set in auto/isolation
If [ $NXT_HAVE_MOUNT = YES -a $NXT_HAVE_UNMOUNT = YES ]; then
NXT_HAVE_ROOTFS=YES
cat << END >> $NXT_AUTO_CONFIG_H
#ifndef NXT_HAVE_ISOLATION_ROOTFS
#define NXT_HAVE_ISOLATION_ROOTFS 1
#endif
END
fi
While we do have a check for a generic umount(2) which is found on
MacOS, for mount(2) we currently only check for the Linux mount(2) and
FreeBSD nmount(2) system calls. So NXT_HAVE_ROOTFS is set to NO on MacOS
and we don't build src/nxt_fs.c
This fixes the immediate build issue by taking the mount/umount OS
support out of nxt_fs.c into a new nxt_fs_mount.c file which is guarded
by the above while we now build nxt_fs.c unconditionally.
This should fix the build on any _supported_ system.
Reported-by: Alejandro Colomar <alx@nginx.com >
Fixes: 57fc920 ("Socket: Created control socket & pid file directories.")
Signed-off-by: Andrew Clayton <a.clayton@nginx.com >
2022-10-14 12:25:47 +01:00
..
2022-10-03 14:32:28 +01:00
2022-10-03 14:32:28 +01:00
2022-10-03 14:32:28 +01:00
2022-10-03 14:32:28 +01:00
2022-10-04 19:33:11 +01:00
2022-10-03 14:32:28 +01:00
2017-02-22 15:09:59 +03:00
2021-03-24 08:05:07 +03:00
2020-08-11 19:20:34 +03:00
2020-12-18 00:25:27 +03:00
2022-08-11 13:33:46 +01:00
2021-11-24 13:11:47 +03:00
2020-08-13 02:46:54 +03:00
2022-05-03 12:11:14 +02:00
2022-05-03 12:11:14 +02:00
2017-06-20 19:49:17 +03:00
2017-06-20 19:49:17 +03:00
2020-02-03 11:14:14 +03:00
2022-05-03 12:11:14 +02:00
2021-08-03 13:59:27 +03:00
2022-05-03 12:11:14 +02:00
2022-05-03 12:11:14 +02:00
2017-01-30 16:47:50 +03:00
2020-05-28 14:57:41 +01:00
2020-05-28 14:57:41 +01:00
2022-02-14 20:14:03 +08:00
2020-03-09 16:28:25 +00:00
2022-05-03 12:11:14 +02:00
2022-07-18 19:09:30 +02:00
2020-09-16 17:52:53 +01:00
2022-08-18 18:56:24 +02:00
2022-08-29 14:27:09 +08:00
2022-08-29 14:27:09 +08:00
2022-08-29 14:27:09 +08:00
2022-09-22 01:01:18 +08:00
2020-04-08 15:15:24 +03:00
2017-06-27 17:27:18 +03:00
2019-11-14 16:39:48 +03:00
2020-08-17 12:28:48 +03:00
2018-09-20 15:05:37 +03:00
2022-09-22 01:01:18 +08:00
2022-10-03 14:26:45 +01:00
2019-12-06 16:52:50 +00:00
2019-12-06 16:52:50 +00:00
2018-03-05 17:32:50 +03:00
2018-03-05 17:32:50 +03:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2020-04-15 14:54:09 +03:00
2018-06-25 16:51:47 +03:00
2022-05-03 12:11:14 +02:00
2019-02-28 18:04:11 +03:00
2021-08-03 13:59:27 +03:00
2022-08-29 14:32:20 +08:00
2018-03-05 17:32:50 +03:00
2021-11-24 13:11:47 +03:00
2017-01-23 19:56:03 +03:00
2022-05-03 12:11:14 +02:00
2017-06-20 19:49:17 +03:00
2018-03-29 16:35:36 +03:00
2022-05-03 12:11:14 +02:00
2022-05-03 12:11:14 +02:00
2017-01-30 16:47:50 +03:00
2017-01-17 20:00:00 +03:00
2017-06-14 15:18:52 +03:00
2017-06-20 19:49:17 +03:00
2017-06-20 19:49:17 +03:00
2021-04-29 22:04:34 +08:00
2022-05-03 12:11:14 +02:00
2017-02-22 15:09:59 +03:00
2022-10-14 12:25:47 +01:00
2022-10-14 12:25:47 +01:00
2022-10-14 12:25:47 +01:00
2022-10-14 12:25:47 +01:00
2017-01-17 20:00:00 +03:00
2022-04-26 12:38:48 +02:00
2021-09-20 09:01:08 +03:00
2022-08-29 14:27:09 +08:00
2020-06-23 14:16:45 +03:00
2017-01-17 20:00:00 +03:00
2019-03-11 17:31:59 +03:00
2022-05-03 12:11:14 +02:00
2019-11-14 16:39:54 +03:00
2022-06-22 00:30:44 +02:00
2022-06-22 00:30:44 +02:00
2021-07-26 15:00:46 +08:00
2022-10-12 08:21:02 +08:00
2020-04-16 17:09:23 +03:00
2022-07-14 04:32:49 +08:00
2022-07-26 16:24:33 +02:00
2022-07-26 16:24:33 +02:00
2022-07-26 16:24:33 +02:00
2017-06-20 19:49:17 +03:00
2017-06-20 19:49:17 +03:00
2022-07-28 11:05:04 +08:00
2022-10-12 08:21:02 +08:00
2020-08-11 19:20:34 +03:00
2022-10-12 08:21:02 +08:00
2022-08-02 19:50:10 +02:00
2022-08-18 15:43:03 +02:00
2021-10-28 17:46:54 +03:00
2017-06-20 19:49:17 +03:00
2017-08-24 17:43:32 +03:00
2017-08-28 10:20:40 +03:00
2017-06-20 19:49:17 +03:00
2017-08-24 17:43:32 +03:00
2022-05-03 12:11:14 +02:00
2020-03-04 14:03:30 +03:00
2020-10-14 18:41:31 +03:00
2018-01-24 15:16:33 +03:00
2017-06-28 23:52:07 +03:00
2022-05-03 12:11:14 +02:00
2020-04-08 15:15:24 +03:00
2020-04-08 15:15:24 +03:00
2020-04-15 14:54:09 +03:00
2022-05-03 12:11:14 +02:00
2021-03-24 08:05:07 +03:00
2022-05-03 12:11:14 +02:00
2022-05-03 12:11:14 +02:00
2022-05-03 12:11:14 +02:00
2017-06-14 15:18:52 +03:00
2022-08-18 18:55:14 +02:00
2021-11-09 15:48:44 +03:00
2021-12-01 17:09:02 +03:00
2022-10-14 12:25:47 +01:00
2022-02-22 19:18:18 +08:00
2022-05-03 12:11:14 +02:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2017-03-09 18:03:27 +03:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2022-05-03 12:11:14 +02:00
2022-06-22 00:30:44 +02:00
2020-08-13 02:46:54 +03:00
2018-04-04 18:13:05 +03:00
2017-01-17 20:00:00 +03:00
2022-07-18 19:09:30 +02:00
2022-07-18 19:09:30 +02:00
2022-05-12 12:04:54 +04:00
2017-04-10 03:43:00 +03:00
2017-01-17 20:00:00 +03:00
2021-05-05 17:23:33 +08:00
2020-11-17 15:03:30 +00:00
2022-10-03 14:32:28 +01:00
2018-03-05 17:32:50 +03:00
2019-03-11 17:31:59 +03:00
2018-03-05 17:32:50 +03:00
2018-03-29 16:35:38 +03:00
2018-03-29 16:35:38 +03:00
2022-06-22 00:30:44 +02:00
2022-06-07 13:59:45 +08:00
2022-06-07 13:59:45 +08:00
2020-08-11 19:20:34 +03:00
2022-06-07 13:59:45 +08:00
2020-05-28 12:41:00 +03:00
2022-06-22 00:30:44 +02:00
2021-11-24 13:11:48 +03:00
2022-08-29 14:27:09 +08:00
2017-03-14 19:03:49 +03:00
2021-11-09 15:48:44 +03:00
2022-08-11 13:33:46 +01:00
2022-08-11 13:33:46 +01:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2018-07-27 17:52:21 +03:00
2017-08-30 00:31:02 +03:00
2017-05-29 10:17:36 +03:00
2017-03-14 19:02:30 +03:00
2017-01-17 20:00:00 +03:00
2017-01-17 20:00:00 +03:00
2020-11-17 15:03:30 +00:00
2022-07-28 11:05:04 +08:00
2021-03-25 14:16:30 +03:00
2022-10-03 14:32:28 +01:00
2022-07-28 11:05:04 +08:00
2022-10-03 14:26:45 +01:00
2021-11-09 15:48:44 +03:00
2017-06-14 15:18:52 +03:00
2017-01-17 20:00:00 +03:00
2017-01-17 20:00:00 +03:00
2019-11-14 16:39:48 +03:00
2018-09-20 15:05:37 +03:00
2018-03-05 17:32:50 +03:00
2022-05-03 12:11:14 +02:00
2019-08-20 16:31:53 +03:00
2019-08-20 16:31:53 +03:00
2020-03-09 16:28:25 +00:00
2017-08-24 17:43:32 +03:00
2022-05-03 12:11:14 +02:00
2022-08-18 18:58:41 +02:00
2022-08-11 18:43:12 +02:00
2021-11-09 15:48:44 +03:00
2021-11-09 15:48:44 +03:00
2020-06-23 14:16:43 +03:00
2022-05-03 12:11:14 +02:00
2021-11-09 15:48:44 +03:00
2017-02-22 15:09:59 +03:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2018-09-17 16:37:17 +03:00
2018-09-17 16:37:17 +03:00
2022-06-01 16:40:34 +01:00
2017-01-17 20:00:00 +03:00
2022-09-06 09:40:54 +08:00
2022-08-29 14:32:20 +08:00
2018-01-24 15:16:32 +03:00
2017-06-14 15:18:52 +03:00
2017-06-14 15:18:52 +03:00
2022-06-22 00:30:44 +02:00
2022-06-22 00:30:44 +02:00
2017-01-17 20:00:00 +03:00
2017-01-17 20:00:00 +03:00
2018-03-05 17:32:50 +03:00
2022-05-03 12:11:14 +02:00
2018-03-05 17:32:50 +03:00
2018-03-05 17:32:50 +03:00
2018-01-24 15:16:33 +03:00
2017-01-27 11:35:11 +03:00
2017-08-24 17:43:32 +03:00
2022-05-03 12:11:14 +02:00
2018-07-27 17:52:21 +03:00
2022-05-03 12:11:14 +02:00
2022-06-22 00:30:44 +02:00
2017-01-17 20:00:00 +03:00
2022-05-03 12:11:14 +02:00
2019-02-26 17:42:20 +03:00
2019-03-11 17:31:59 +03:00
2021-10-26 15:43:44 +03:00
2018-06-25 16:51:47 +03:00
2018-04-04 18:13:05 +03:00
2019-03-11 17:31:59 +03:00
2018-04-04 18:13:05 +03:00
2019-11-14 16:39:54 +03:00
2022-10-03 14:32:28 +01:00
2018-08-06 17:27:33 +03:00
2018-08-06 17:27:33 +03:00
2019-08-20 16:31:53 +03:00
2019-08-20 16:31:53 +03:00
2022-09-10 02:57:42 +02:00
2021-11-24 13:11:47 +03:00
2022-07-18 19:09:30 +02:00
2020-03-30 19:47:01 +03:00
2017-06-20 19:49:17 +03:00
2018-06-25 16:51:47 +03:00
2021-09-07 21:13:44 +08:00
2020-03-06 18:28:54 +03:00
2018-04-04 18:13:05 +03:00
2018-04-04 18:13:05 +03:00
2022-07-28 11:05:04 +08:00
2022-07-28 11:05:04 +08:00
2017-06-27 17:27:18 +03:00
2022-05-03 12:11:14 +02:00
2022-06-22 00:30:44 +02:00
2019-08-20 16:31:53 +03:00
2019-10-10 19:42:41 +03:00
2019-08-20 16:31:53 +03:00
2018-02-07 15:34:42 +03:00
2022-05-03 12:11:14 +02:00