Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#64376 closed defect (fixed)

lighttpd @1.4.63_2+ssl: build fails on MacOS 10.15.7, linker complains about for x86_64 undefined symbols

Reported by: Gandoon (Erik Hedlund) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: catalina Cc:
Port: lighttpd

Description

lighttpd fails to build on Catalina (10.15.7) with the standard port file. One workaround seems to be to substitute the distributed configure.args-append with the following:

configure.args-append       CC_FOR_BUILD=/opt/local/bin/clang \
                            #"${configure.cc}" \
                            CFLAGS_FOR_BUILD="${configure.cflags}" \
                            --with-brotli \
                            --with-lua \
                            --with-pcre2 \
                            --with-xxhash \
                            --with-zlib \
                            --with-zstd \
                            ac_cv_prog_AWK=/usr/bin/awk

Curiously enough, I only had a successful build if I left the commented out #"${configure.cc}" in the precise position above. I do not know if this is an issue that has affected others, but this trick to try to force the use of the MacPorts built clang-13 in place of the system provided clang-12 seemed to solve the issue in this case.

There may be an issue with linking against lua for the Apple provided compiler. However, I do not claim any expertise here, but I found a workaround for now. It would be great if someone could look into this. The error was reproducible by reverting to the original port file. A copy of the log of the failure is attached.

Git is the port installed that depends on lighttpd, and it builds fine after the successful build of lighttpd using the aforementioned workaround.

Attachments (1)

lighttpd-main.log (211.0 KB) - added by Gandoon (Erik Hedlund) 2 years ago.
logfile of the failed build

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by Gandoon (Erik Hedlund)

Attachment: lighttpd-main.log added

logfile of the failed build

comment:1 Changed 2 years ago by jmroot (Joshua Root)

Owner: set to ryandesign
Status: newassigned

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

git only depends on lighttpd if you use the +gitweb variant.

lighttpd @1.4.63_2+ssl built fine for me on Catalina; I'll compare my log with yours.

comment:3 in reply to:  2 Changed 2 years ago by Gandoon (Erik Hedlund)

Replying to ryandesign:

git only depends on lighttpd if you use the +gitweb variant.

lighttpd @1.4.63_2+ssl built fine for me on Catalina; I'll compare my log with yours.

True, my git does want it…

It was a weird one this error, it persisted for a few weeks until I took the time to try to fix it for myself. I found the mentioned workaround and then on recommendation from people on the IRC submitted the ticket. I could eventually build it, but something seemed fishy.

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

Keywords: catalina added; Catalina removed
Status: assignedaccepted

Your configure output says:

:info:configure checking if lua-support is requested... yes
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.4
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua-5.4
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.3
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua-5.3
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.2
:info:configure checking for LUA... yes

and later it links with the lua 5.2 library using -llua-5.2.

Mine says:

:info:configure checking if lua-support is requested... yes
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.4
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua-5.4
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.3
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua-5.3
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.2
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua-5.2
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua5.1
:info:configure checking for LUA... no
:info:configure configure: Couldn\'t find lua-5.1
:info:configure checking for LUA... yes

and later it links with the unversioned lua library with -llua.

If I install the lua52 port, then I can get lighttpd to fail to build as you did.

So we need to tell the build system to use the unversioned lua library, since that's the one we're declaring a dependency on.

The reason why the build "worked" when you made the modification you did is that you commented out all of the configure arguments, including the one that enables lua support. Portfiles are written in the Tcl language, and in Tcl a backslash at the end of a line continues that line to the next one—even comment lines.

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In d3a737e4fd41fc93eb306483065e21585f84070b/macports-ports (master):

lighttpd: Use the right lua

Fixes build failure when lua52 is installed.

Closes: #64376

comment:6 in reply to:  4 Changed 2 years ago by Gandoon (Erik Hedlund)

Replying to ryandesign:

. . .

and later it links with the unversioned lua library with -llua.

If I install the lua52 port, then I can get lighttpd to fail to build as you did.

So we need to tell the build system to use the unversioned lua library, since that's the one we're declaring a dependency on.

Right, that make sense…

The reason why the build "worked" when you made the modification you did is that you commented out all of the configure arguments, including the one that enables lua support. Portfiles are written in the Tcl language, and in Tcl a backslash at the end of a line continues that line to the next one—even comment lines.

Ah, I did indeed overlook that (I am not using Tcl very often, so that one would be on me)… I will indeed make sure I check so that things work correctly knowing this. Thank you for the effort.

I should evidently revisit my lua and make sure it is healthy. It is not the first time it has caused me troubles (mpv comes to mind…).

O, and of course, thanks for the help… it all works as expected agaim :)

Last edited 2 years ago by Gandoon (Erik Hedlund) (previous) (diff)
Note: See TracTickets for help on using tickets.