Bug 237165 - sysutils/bareos-server: linker error: undefined reference to json
Summary: sysutils/bareos-server: linker error: undefined reference to json
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Jose Alonso Cardenas Marquez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-09 16:40 UTC by O. Hartmann
Modified: 2019-11-07 12:42 UTC (History)
1 user (show)

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


Attachments
bareos-server patch: add -ljansson to ports main Makefile LDFLAGS (475 bytes, patch)
2019-04-26 09:25 UTC, O. Hartmann
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2019-04-09 16:40:14 UTC
Recent update of port susutils/bareos-server fails with the error:

[...]
Linking bareos-sd ...
/usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/libtool --silent --tag=CXX --mode=link /usr/bin/c++  -L/usr/local/lib -L/usr/local/lib  -L/usr/local/lib -fstack-protector -L. -L../lib -o bareos-sd append.o askdir.o authenticate.o dir_cmd.o fd_cmds.o job.o mac.o ndmp_tape.o read.o sd_cmds.o sd_stats.o socket_server.o status.o stored.o  -L../ndmp -lbareosndmp -lbareossd -lbareoscfg -lbareos -lm  -lpthread  -lintl      -lwrap   /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib  -L/usr/lib -lssl -lcrypto  -L/usr/local/lib -ljansson
--- bcopy ---
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_delete
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_dumps
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_integer
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_object
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_object_set_new
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_string
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [bcopy] Error code 1
Comment 1 O. Hartmann 2019-04-26 09:25:41 UTC
Created attachment 204035 [details]
bareos-server patch: add -ljansson to ports main Makefile LDFLAGS

Attached, you'll find a patch to workaround the problem I discovered while compiling sysutils/bareos-server. Obviously, the linker does not find libjansson.so, so adding "-ljansson" to port's Makefile LDFLAG tag solves the problem for me. See attached pacth.
Comment 2 commit-hook freebsd_committer 2019-05-09 18:05:18 UTC
A commit references this bug:

Author: acm
Date: Thu May  9 18:04:41 UTC 2019
New revision: 501125
URL: https://svnweb.freebsd.org/changeset/ports/501125

Log:
  - Copy bareos-* ports to bareos17-* ports. bareos-* ports will be updated to
    latest version
  - Fix bareos17-server build [1]
  - Fix installation of sample files
  - Bump PORTREVISION

  PR:		230456 237165
  Reported by:	ohartmann at walstatt.org [1], okrg at ukr.net [1]

Changes:
  head/sysutils/Makefile
  head/sysutils/bareos17-client/
  head/sysutils/bareos17-client/Makefile
  head/sysutils/bareos17-server/
  head/sysutils/bareos17-server/Makefile
  head/sysutils/bareos17-server/files/patch-src-dird-Makefile.in
  head/sysutils/bareos17-server/files/patch-src-filed-Makefile.in
  head/sysutils/bareos17-server/files/patch-src-stored-Makefile.in
Comment 3 O. Hartmann 2019-06-05 08:36:50 UTC
This problem is now again present in sysutils/bareos-server (18.2.6)!

The same "trick" as described prior for Version 17 makes the port compile as well as with poudriere and via make.

Please fix. See patch above.

Thanks in advance.
Comment 4 O. Hartmann 2019-07-27 19:25:35 UTC
The problem is still present!
Comment 5 O. Hartmann 2019-10-14 12:54:41 UTC
The problem reported is still present with poudriere on a CURRENT server running poudriere for a FreeBSD 12-STABLE jail:

host: FreeBSD 13.0-CURRENT #3 r353485: Mon Oct 14 07:07:10 CEST 2019 amd64
ports tree: r514457
poudriere: 3.3.2_1
Jail OSVERSION: 1201500 (12-STABLE)

Linking of bareos-server 18 fails at the same stage as reported initially in this PR.

There is no problem running same as above poudriere with a jail 11.3-RELENG!

Jail CURRENT is also failing.
Comment 6 bas 2019-11-07 12:42:30 UTC
Fails on 12.1-RELEASE as well. Workaround patch by O. Hartmann fixes it for me.