[sr-dev] [kamailio/kamailio] src/Makefile: Also stop compiling kamcmd from here (PR #3020)

Adrian Bunk notifications at github.com
Tue Feb 8 16:47:41 CET 2022


Building ``kamcmd`` twice was not only a (marginal) waste of build time, but also created a race condition where the first linking sometimes failed due to reading the incomplete file from the ongoing second build of ``kamcmd.o``:

https://buildd.debian.org/status/fetch.php?pkg=kamailio&arch=s390x&ver=5.5.3-1&stamp=1638905109&raw=0

```
gcc -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DVERSION_NODATE    -DNAME='"kamcmd"' -DSRNAME='"kamailio"' -DVERSION='"1.5"' -D__OS_linux -DRUN_DIR='"/var/run/kamailio/"'  -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DMOD_NAME="utils/kamcmd" -c kamcmd.c -o kamcmd.o
...
gcc -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DVERSION_NODATE    -DNAME='"kamcmd"' -DSRNAME='"kamailio"' -DVERSION='"1.5"' -D__OS_linux -DRUN_DIR='"/var/run/kamailio/"'  -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DMOD_NAME="utils/kamcmd" -c kamcmd.c -o kamcmd.o
gcc -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DVERSION_NODATE    -DNAME='"kamcmd"' -DSRNAME='"kamailio"' -DVERSION='"1.5"' -D__OS_linux -DRUN_DIR='"/var/run/kamailio/"'  -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DMOD_NAME="utils/kamcmd" -c parse_listen_id.c -o parse_listen_id.o
gcc -g -Wl,-O2 -Wl,-E  -Wl,-z,relro -Wl,-z,now -pthread -rdynamic "-ldl" -Wl,-Bsymbolic-functions kamcmd.o parse_listen_id.o  -lresolv -lreadline   -o kamcmd
/usr/bin/ld: /usr/lib/gcc/s390x-linux-gnu/11/../../../s390x-linux-gnu/Scrt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
collect2: error: ld returned 1 exit status
make[4]: *** [../../src//Makefile.rules:191: kamcmd] Error 1
make[3]: *** [Makefile:536: utils] Error 1
make[3]: *** Waiting for unfinished jobs....
gcc -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DVERSION_NODATE    -DNAME='"kamcmd"' -DSRNAME='"kamailio"' -DVERSION='"1.5"' -D__OS_linux -DRUN_DIR='"/var/run/kamailio/"'  -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DMOD_NAME="utils/kamcmd" -c parse_listen_id.c -o parse_listen_id.o
gcc -g -Wl,-O2 -Wl,-E  -Wl,-z,relro -Wl,-z,now -pthread -rdynamic "-ldl" -Wl,-Bsymbolic-functions kamcmd.o parse_listen_id.o  -lresolv -lreadline   -o kamcmd
```
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3020

-- Commit Summary --

  * src/Makefile: Also stop compiling kamcmd from here

-- File Changes --

    M src/Makefile (2)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/3020.patch
https://github.com/kamailio/kamailio/pull/3020.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3020
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3020 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220208/b553ff55/attachment.htm>


More information about the sr-dev mailing list