Opened 4 years ago

Closed 12 days ago

#61744 closed defect (fixed)

bacula @9.4.4 +console_bat : does not build on macOS 11.4 (bigsur)

Reported by: timmr Owned by: dgilman (David Gilman)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: bigsur Cc: naos0815
Port: bacula

Description

building bacula failed on macOS 11.0 (variants +client_only+console_bat):

:info:build Making libbaccfg.la ...
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_bacula/bacula/work/bacula-9.4.4/libtool --silent --tag=
CXX --mode=link /usr/bin/clang++   -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -o libbaccfg.la ini.lo parse_conf.lo res.lo bjson.lo  -expor
t-dynamic -rpath /opt/local/lib -release 9.4.4 -L/opt/local/lib -lssl -lcrypto -lpthread  -lintl
:info:build Undefined symbols for architecture x86_64:
:info:build   "bvsnprintf(char*, int, char const*, __va_list_tag*)", referenced from:
:info:build       s_err(char const*, int, s_lex_context*, char const*, ...) in ini.o
:info:build       sendit(void*, char const*, ...) in bjson.o
:info:build   "edit_int64(long long, char*)", referenced from:
:info:build       display_int32_pair(HPKT&) in bjson.o
:info:build       display_int64_pair(HPKT&) in bjson.o
...
:info:build      (maybe you meant: CONFIG::free_all_resources())
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[1]: *** [libbaccfg.la] Error 1
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_bacula/bacula/work/bacula-9.4.4/src/lib'
:info:build   ====== Error in /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_bacula/bacula/work/bacula-9.4.4/src/lib ======

(full log attached)

Attachments (1)

main.log (116.4 KB) - added by timmr 4 years ago.
full log

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by timmr

Attachment: main.log added

full log

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Probably the well-known libtool bug on macOS 11+.

comment:2 Changed 3 years ago by timmr

Summary: bacula @9.4.4 +console_bat : does not build on macOS 11.0.1 (bigsur)bacula @9.4.4 +console_bat : does not build on macOS 11.4 (bigsur)
Version: 2.6.42.7.1

comment:3 Changed 3 years ago by timmr

Thanks for commenting - any link regarding the well-known libtool bug? Or even better, any way to circumvent this as a non posix/c/cxx dev?

comment:4 Changed 3 years ago by OrvGull

The patch found here works: https://www.mail-archive.com/libtool-patches@gnu.org/msg07396.html (Not attached here because I don't own the code, but it's a very simple patch.)

The part I'm having trouble with is generating a new configure script, once libtool.m4 is patched. I'm not too experienced with autoconf, and make configure in the Bacula source directory results in a non-working script. It can be hacked into working by hand editing configure and adding BUILD_DIR=`pwd` near the top, but that's not a proper fix. This would probably be an easy patch for someone who understands autoconf, though.

comment:5 Changed 3 years ago by OrvGull

@timmr - If you just need to get it working, you can do the following rather convoluted method:

port install autoconf
port extract bacula
WORKDIR=`port work bacula`
cd $WORKDIR/bacula-9.4.4

Fix autoconf/libtool/libtool.m4 with the patch linked above. It's only two lines, so if you're not too comfortable with patch you can just edit the file by hand. Then:

touch autoconf/aclocal.m4
./configure --enable-client-only
make configure

(Note the run of ./configure there is not the one that'll be used for the build; port will re-run it, so don't worry too much about setting configuration flags. We just need a valid config.status file or make configure will choke.)

Now edit configure and put BUILD_DIR=`PWD` near the top. It's already in the file, but in the wrong place; the variable gets used before it's set, and the script fails.

Finally:

port build bacula

If the build succeeds, you should be able to do port install bacula.

I can't reasonably do this whole rigamarole on multiple workstations, so I'm hoping someone smarter than me comes up with a proper fix. ;)

Version 0, edited 3 years ago by OrvGull (next)

comment:6 Changed 3 years ago by timmr

@OrvGull - thank you very much for your detailed instructions for a work-around... with these, I was finally able to install the bat- utility and file daemon on Bigsur - thanks a lot!

comment:7 Changed 3 years ago by OrvGull

This work-around still works for macOS Monterey, but where the patch has "10.*|11.*)" you need to change it to "10.*|11.*|12.*)".

comment:8 Changed 3 years ago by OrvGull

With arm64 machines you'll need to use the port flags "+client_only -console_bat" because BAT requires qt4-mac, which does not build on arm64.

comment:9 Changed 6 weeks ago by naos0815

Cc: naos0815 added

comment:10 Changed 12 days ago by dgilman (David Gilman)

Owner: set to dgilman
Resolution: fixed
Status: newclosed

In 8c3932f1a9a7d2dd21b387729b2887eef2e5823b/macports-ports (master):

bacula: update to 15.0.2

Closes: #61744

Note: See TracTickets for help on using tickets.