Bug 225581 - net/mosquitto: Fails to compile
Summary: net/mosquitto: Fails to compile
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-31 10:51 UTC by Tim McCormick
Modified: 2018-10-22 20:00 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (joe)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim McCormick 2018-01-31 10:51:45 UTC
Attempting to compile mosquitto 1.4.14 from net/mosquitto fails on FreeBSD 11.1-RELEASE-p4:

FAILED: src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o
/usr/bin/cc -DCMAKE -DTIMESTAMP="\"2018-01-31 08:54:39+0000\"" -DVERSION=\"1.4.14\" -DWITH_BRIDGE -DWITH_BROKER -DWITH_EC -DWITH_MEMORY_TRACKING -DWITH_PERSISTENCE -DWITH_SOCKS -DWITH_SYS_TREE -DWITH_THREADING -DWITH_TLS -DWITH_TLS_PSK -DWITH_WEBSOCKETS -I/usr/local/include -I. -Isrc -Ilib -O2 -pipe  -fstack-protector -fno-strict-aliasing -O2 -pipe  -fstack-protector -fno-strict-aliasing -MD -MT src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o -MF src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.d -o src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o   -c lib/read_handle_shared.c
In file included from lib/read_handle_shared.c:29:
In file included from lib/util_mosq.h:25:
In file included from src/mosquitto_broker.h:24:
In file included from /usr/local/include/libwebsockets.h:153:
In file included from /usr/local/include/uv.h:62:
In file included from /usr/local/include/uv-unix.h:42:
/usr/include/pthread.h:239:28: error: use of undeclared identifier '__mutex'
                    __requires_unlocked(*__mutex);
                                         ^
/usr/include/pthread.h:242:28: error: use of undeclared identifier '__mutex'
                    __requires_unlocked(*__mutex);
                                         ^
/usr/include/pthread.h:244:26: error: use of undeclared identifier '__mutex'
                    __locks_exclusive(*__mutex);
                                       ^
/usr/include/pthread.h:251:18: error: use of undeclared identifier '__mutex'
                    __unlocks(*__mutex);
                               ^
4 errors generated.

This seems similar to 220827, but that was fixed some time ago. I'm also building with websocket support.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2018-02-23 04:03:02 UTC
(In reply to Tim McCormick from comment #0)

Tim,

I can't reproduce on 10 i386, 11 amd64, 12 amd64, all systems that I normally build on.
Please try again and see if it still breaks for you.

Yuri
Comment 2 Oleg 2018-03-21 20:33:53 UTC
I have the same problem

 make install clean MAKE_JOBS_UNSAFE=yes
===>  Building for mosquitto-1.4.14_1
[1/12] /usr/bin/cc -DCMAKE -DTIMESTAMP="\"2018-03-21 22:25:22+0200\"" -DVERSION=\"1.4.14\" -DWITH_BRIDGE -DWITH_BROKER -DWITH_EC -DWITH_MEMORY_TRACKING -DWITH_PERSISTENCE -DWITH_SOCKS -DWITH_SYS_TREE -DWITH_THREADING -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_WEBSOCKETS -I/usr/local/include -I. -Isrc -Ilib -O2 -pipe  -fstack-protector -fno-strict-aliasing -O2 -pipe  -fstack-protector -fno-strict-aliasing -MD -MT src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o -MF src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.d -o src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o   -c lib/read_handle_shared.c
FAILED: src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o
/usr/bin/cc -DCMAKE -DTIMESTAMP="\"2018-03-21 22:25:22+0200\"" -DVERSION=\"1.4.14\" -DWITH_BRIDGE -DWITH_BROKER -DWITH_EC -DWITH_MEMORY_TRACKING -DWITH_PERSISTENCE -DWITH_SOCKS -DWITH_SYS_TREE -DWITH_THREADING -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_WEBSOCKETS -I/usr/local/include -I. -Isrc -Ilib -O2 -pipe  -fstack-protector -fno-strict-aliasing -O2 -pipe  -fstack-protector -fno-strict-aliasing -MD -MT src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o -MF src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o.d -o src/CMakeFiles/mosquitto.dir/__/lib/read_handle_shared.c.o   -c lib/read_handle_shared.c
In file included from lib/read_handle_shared.c:29:
In file included from lib/util_mosq.h:25:
In file included from src/mosquitto_broker.h:24:
In file included from /usr/local/include/libwebsockets.h:153:
In file included from /usr/local/include/uv.h:62:
In file included from /usr/local/include/uv-unix.h:42:
/usr/include/pthread.h:239:28: error: use of undeclared identifier '__mutex'
                    __requires_unlocked(*__mutex);
                                         ^
/usr/include/pthread.h:242:28: error: use of undeclared identifier '__mutex'
                    __requires_unlocked(*__mutex);
                                         ^
/usr/include/pthread.h:244:26: error: use of undeclared identifier '__mutex'
                    __locks_exclusive(*__mutex);
                                       ^
/usr/include/pthread.h:251:18: error: use of undeclared identifier '__mutex'
                    __unlocks(*__mutex);
                               ^
4 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net/mosquitto
*** Error code 1

Stop.
make: stopped in /usr/ports/net/mosquitto


I'm sure it is related with libwebsockets.
Comment 3 Oleg 2018-03-21 20:34:55 UTC
(In reply to Yuri Victorovich from comment #1)

I was compiling with WS support (the first question when start compilation of mosquito).

My config for libwebsockets was "all checkbox selected" - maybe this helps to reproduce. 

I'm pretty sure it's because of libwebsockets
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2018-03-21 20:42:25 UTC
Reopening.
Comment 5 Walter Schwarzenfeld 2018-03-21 21:07:14 UTC
There was a similar problem bug  #220827.
Comment 6 Walter Schwarzenfeld 2018-03-21 21:24:30 UTC
If it is the same error (I don't know cause I also cannot reproduce the error)
Try to change in the Makefile
WS_CMAKE_ON=    -DWITH_WEBSOCKETS=ON

to

WS_CMAKE_ON=    -DWITH_WEBSOCKETS=ON  -DWITH_THREADING=ON
Comment 7 Nathan 2018-08-28 02:21:53 UTC
Tested on 12-CURRENT,r338331 and i get no error with WS on
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2018-08-28 02:27:54 UTC
Close based on comment#7.

Thanks, Nathan!
Comment 9 joe 2018-10-22 19:59:12 UTC
Last committer: lwhsu@FreeBSD.org
Ident:          $FreeBSD: head/net/mosquitto/Makefile 481153 2018-10-03 09:54:40Z lwhsu $
Log URL:        http://beefy12.nyi.freebsd.org/data/head-amd64-default/p482633_s339515/logs/mosquitto-1.5.3.log
Build URL:      http://beefy12.nyi.freebsd.org/build.html?mastername=head-amd64-default&build=p482633_s339515


These changes introduces a build failure...
Comment 10 joe 2018-10-22 20:00:30 UTC
ignore, wrong bug report...