make: /bin/sh: Operation not permitted
i try to compile opensource project on alpine linux edge and they dont work, they say : make: /bin/sh: Operation not permitted
on 3.12 while compile correctly :
# docker run -it --rm alpine:3.12 /bin/sh
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
v3.12.3-89-g0f8a7b9683 [http://dl-cdn.alpinelinux.org/alpine/v3.12/main]
v3.12.3-89-g0f8a7b9683 [http://dl-cdn.alpinelinux.org/alpine/v3.12/community]
OK: 12747 distinct packages available
/ # apk add git build-base php7-dev libspf2-dev
(1/52) Installing libgcc (9.3.0-r2)
(2/52) Installing libstdc++ (9.3.0-r2)
(3/52) Installing binutils (2.34-r1)
(4/52) Installing libmagic (5.38-r0)
(5/52) Installing file (5.38-r0)
(6/52) Installing gmp (6.2.0-r0)
(7/52) Installing isl (0.18-r0)
(8/52) Installing libgomp (9.3.0-r2)
(9/52) Installing libatomic (9.3.0-r2)
(10/52) Installing libgphobos (9.3.0-r2)
(11/52) Installing mpfr4 (4.0.2-r4)
(12/52) Installing mpc1 (1.1.0-r1)
(13/52) Installing gcc (9.3.0-r2)
(14/52) Installing musl-dev (1.1.24-r10)
(15/52) Installing libc-dev (0.7.2-r3)
(16/52) Installing g++ (9.3.0-r2)
(17/52) Installing make (4.3-r0)
(18/52) Installing fortify-headers (1.1-r0)
(19/52) Installing patch (2.7.6-r6)
(20/52) Installing build-base (0.5-r2)
(21/52) Installing ca-certificates (20191127-r4)
(22/52) Installing nghttp2-libs (1.41.0-r0)
(23/52) Installing libcurl (7.69.1-r3)
(24/52) Installing expat (2.2.9-r1)
(25/52) Installing pcre2 (10.35-r0)
(26/52) Installing git (2.26.2-r0)
(27/52) Installing libspf2 (1.2.10-r4)
(28/52) Installing libspf2-dev (1.2.10-r4)
(29/52) Installing php7-common (7.3.27-r0)
(30/52) Installing argon2-libs (20190702-r1)
(31/52) Installing ncurses-terminfo-base (6.2_p20200523-r0)
(32/52) Installing ncurses-libs (6.2_p20200523-r0)
(33/52) Installing libedit (20191231.3.1-r0)
(34/52) Installing xz-libs (5.2.5-r0)
(35/52) Installing libxml2 (2.9.10-r5)
(36/52) Installing php7 (7.3.27-r0)
(37/52) Installing m4 (1.4.18-r1)
(38/52) Installing libbz2 (1.0.8-r1)
(39/52) Installing perl (5.30.3-r0)
(40/52) Installing perl-error (0.17029-r0)
(41/52) Installing perl-git (2.26.2-r0)
(42/52) Installing git-perl (2.26.2-r0)
(43/52) Installing autoconf (2.69-r2)
(44/52) Installing pkgconf (1.7.2-r0)
(45/52) Installing ncurses-dev (6.2_p20200523-r0)
(46/52) Installing libedit-dev (20191231.3.1-r0)
(47/52) Installing zlib-dev (1.2.11-r3)
(48/52) Installing libpcre2-16 (10.35-r0)
(49/52) Installing libpcre2-32 (10.35-r0)
(50/52) Installing pcre2-dev (10.35-r0)
(51/52) Installing php7-static (7.3.27-r0)
(52/52) Installing php7-dev (7.3.27-r0)
Executing busybox-1.31.1-r19.trigger
Executing ca-certificates-20191127-r4.trigger
OK: 327 MiB in 66 packages
/ # git clone https://github.com/ZenProjects/php-spf.git php-spf
Cloning into 'php-spf'...
remote: Enumerating objects: 71, done.
remote: Total 71 (delta 0), reused 0 (delta 0), pack-reused 71
Receiving objects: 100% (71/71), 15.30 KiB | 382.00 KiB/s, done.
Resolving deltas: 100% (38/38), done.
/ # cd php-spf/
/php-spf # phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
/php-spf # ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib
checking for PHP extension directory... /usr/lib/php7/modules
checking for PHP installed headers prefix... /usr/include/php7
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for spf support... yes, shared
checking for spf files in default path... found in /usr
checking for SPF_server_new in -lspf2... yes
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
/php-spf # make
/bin/sh /php-spf/libtool --mode=compile cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -o spf.lo
mkdir .libs
cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -fPIC -DPIC -o .libs/spf.o
/bin/sh /php-spf/libtool --mode=link cc -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o spf.la -export-dynamic -avoid-version -prefer-pic -module -rpath /php-spf/modules spf.lo -lspf2
cc -shared .libs/spf.o -lspf2 -Wl,-soname -Wl,spf.so -o .libs/spf.so
creating spf.la
(cd .libs && rm -f spf.la && ln -s ../spf.la spf.la)
/bin/sh /php-spf/libtool --mode=install cp ./spf.la /php-spf/modules
cp ./.libs/spf.so /php-spf/modules/spf.so
cp ./.libs/spf.lai /php-spf/modules/spf.la
PATH="$PATH:/sbin" ldconfig -n /php-spf/modules
----------------------------------------------------------------------
Libraries have been installed in:
/php-spf/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
on edge they fail to compile :
# docker run -it --rm alpine:edge /bin/sh
/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
v3.13.0-1441-g322287f787 [https://dl-cdn.alpinelinux.org/alpine/edge/main]
v3.13.0-1356-gf47fb315ef [https://dl-cdn.alpinelinux.org/alpine/edge/community]
OK: 14058 distinct packages available
/ # apk add git build-base php7-dev libspf2-dev
(1/55) Upgrading musl (1.2.1-r1 -> 1.2.2-r1)
(2/55) Installing libgcc (10.2.1_pre1-r3)
(3/55) Installing libstdc++ (10.2.1_pre1-r3)
(4/55) Installing binutils (2.35.1-r1)
(5/55) Installing libmagic (5.39-r0)
(6/55) Installing file (5.39-r0)
(7/55) Installing libgomp (10.2.1_pre1-r3)
(8/55) Installing libatomic (10.2.1_pre1-r3)
(9/55) Installing libgphobos (10.2.1_pre1-r3)
(10/55) Installing gmp (6.2.1-r0)
(11/55) Installing isl22 (0.22-r0)
(12/55) Installing mpfr4 (4.1.0-r0)
(13/55) Installing mpc1 (1.2.1-r0)
(14/55) Installing gcc (10.2.1_pre1-r3)
(15/55) Installing musl-dev (1.2.2-r1)
(16/55) Installing libc-dev (0.7.2-r3)
(17/55) Installing g++ (10.2.1_pre1-r3)
(18/55) Installing make (4.3-r0)
(19/55) Installing fortify-headers (1.1-r0)
(20/55) Installing patch (2.7.6-r6)
(21/55) Installing build-base (0.5-r2)
(22/55) Installing ca-certificates (20191127-r5)
(23/55) Installing brotli-libs (1.0.9-r3)
(24/55) Installing nghttp2-libs (1.43.0-r0)
(25/55) Installing libcurl (7.75.0-r0)
(26/55) Installing expat (2.2.10-r1)
(27/55) Installing pcre2 (10.36-r0)
(28/55) Installing git (2.30.0-r0)
(29/55) Installing libspf2 (1.2.10-r4)
(30/55) Installing libspf2-dev (1.2.10-r4)
(31/55) Installing php7-common (7.4.15-r0)
(32/55) Installing argon2-libs (20190702-r1)
(33/55) Installing ncurses-terminfo-base (6.2_p20210130-r0)
(34/55) Installing ncurses-libs (6.2_p20210130-r0)
(35/55) Installing libedit (20191231.3.1-r1)
(36/55) Installing xz-libs (5.2.5-r0)
(37/55) Installing libxml2 (2.9.10-r6)
(38/55) Installing php7 (7.4.15-r0)
(39/55) Installing m4 (1.4.18-r2)
(40/55) Installing libbz2 (1.0.8-r1)
(41/55) Installing perl (5.32.1-r0)
(42/55) Installing perl-error (0.17029-r1)
(43/55) Installing perl-git (2.30.0-r0)
(44/55) Installing git-perl (2.30.0-r0)
(45/55) Installing autoconf (2.69-r3)
(46/55) Installing pkgconf (1.7.3-r0)
(47/55) Installing ncurses-dev (6.2_p20210130-r0)
(48/55) Installing libedit-dev (20191231.3.1-r1)
(49/55) Installing zlib-dev (1.2.11-r3)
(50/55) Installing libpcre2-16 (10.36-r0)
(51/55) Installing libpcre2-32 (10.36-r0)
(52/55) Installing pcre2-dev (10.36-r0)
(53/55) Installing re2c (1.3-r1)
(54/55) Installing php7-static (7.4.15-r0)
(55/55) Installing php7-dev (7.4.15-r0)
Executing busybox-1.32.0-r3.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 305 MiB in 68 packages
/ # git clone https://github.com/ZenProjects/php-spf.git php-spf
Cloning into 'php-spf'...
remote: Enumerating objects: 71, done.
remote: Total 71 (delta 0), reused 0 (delta 0), pack-reused 71
Receiving objects: 100% (71/71), 15.30 KiB | 340.00 KiB/s, done.
Resolving deltas: 100% (38/38), done.
/ # cd php-spf/
/php-spf # phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
/php-spf # ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib
checking for PHP extension directory... /usr/lib/php7/modules
checking for PHP installed headers prefix... /usr/include/php7
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for spf support... yes, shared
checking for spf files in default path... found in /usr
checking for SPF_server_new in -lspf2... yes
checking for a sed that does not truncate output... /bin/sed
checking for ld used by cc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-alpine-linux-musl/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/php-spf # make
/bin/sh /php-spf/libtool --mode=compile cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -o spf.lo
make: /bin/sh: Operation not permitted
make: *** [Makefile:192: spf.lo] Error 127
if i execute each command outside of make they execute correctly, but when are executed with make they return the error Operation not permitted
.
/php-spf # make
/bin/sh /php-spf/libtool --mode=compile cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -o spf.lo
make: /bin/sh: Operation not permitted
make: *** [Makefile:192: spf.lo] Error 127
/php-spf # /bin/sh /php-spf/libtool --mode=compile cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM
-I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -o spf.lo
mkdir .libs
cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -fPIC -DPIC -o .libs/spf.o
/php-spf # make
/bin/sh /php-spf/libtool --mode=link cc -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o spf.la -export-dynamic -avoid-version -prefer-pic -module -rpath /php-spf/modules spf.lo -lspf2
make: /bin/sh: Operation not permitted
make: *** [Makefile:197: spf.la] Error 127
/php-spf # /bin/sh /php-spf/libtool --mode=compile cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM
-I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -o spf.lo
cc -I. -I/php-spf -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /php-spf/spf.c -fPIC -DPIC -o .libs/spf.o
/php-spf # /bin/sh /php-spf/libtool --mode=link cc -DPHP_ATOM_INC -I/php-spf/include -I/php-spf/main -I/php-spf -I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/TSRM -I/usr/include/php
7/Zend -I/usr/include/php7/ext -I/usr/include/php7/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o spf.la -export-dynamic -avoid-version -prefer-pic -module -rpath /php-spf/modules spf.lo -lspf2
cc -shared .libs/spf.o -lspf2 -Wl,-soname -Wl,spf.so -o .libs/spf.so
creating spf.la
(cd .libs && rm -f spf.la && ln -s ../spf.la spf.la)
/php-spf # make
/bin/sh /php-spf/libtool --mode=install cp ./spf.la /php-spf/modules
make: /bin/sh: Operation not permitted
make: *** [Makefile:194: /php-spf/modules/spf.la] Error 127
/php-spf # /bin/sh /php-spf/libtool --mode=install cp ./spf.la /php-spf/modules
cp ./.libs/spf.so /php-spf/modules/spf.so
cp ./.libs/spf.lai /php-spf/modules/spf.la
PATH="$PATH:/sbin" ldconfig -n /php-spf/modules
----------------------------------------------------------------------
Libraries have been installed in:
/php-spf/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------