Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#14214 - [syslog-ng] 3.0.1-6 PKGBUILD from ABS fails

Attached to Project: Arch Linux
Opened by Lee Jackson (ProfessorTomoe) - Monday, 13 April 2009, 13:47 GMT
Last edited by Allan McRae (Allan) - Saturday, 11 July 2009, 10:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Aaron Griffin (phrakture)
Thomas B├Ąchler (brain0)
Allan McRae (Allan)
Hugo Doria (hdoria)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No


The PKGBUILD of syslog-ng 3.0.1-6 from ABS fails with the following message:

/usr/bin/ld: cannot find -lcap
collect2: ld returned 1 exit status

I have verified that libcap 2.16-3 is installed on my system:

$ locate libcap
This task depends upon

Closed by  Allan McRae (Allan)
Saturday, 11 July 2009, 10:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  syslog-ng-3.0.3-1
Comment by Gerardo Exequiel Pozzi (djgera) - Monday, 13 April 2009, 17:15 GMT
It fails because tries to compile it as static (and libcap as static don't exists), (this dependecy is autodetected)

In official arch build don't fails, because developers build under chroot env.

Also syslog-ng, compiles other libs as static (because is configured in "mixed mode"), this is a bad idea, but decreses the dependencies.
gcc -march=i686 -mtune=generic -O2 -pipe -Wall -o syslog-ng main.o libsyslog-ng.a -lrt -lnsl -Wl,-Bstatic -lfl -lglib-2.0 -levtlog -lssl -lcrypto -lz -lz -lwrap -lcap -lpcre -Wl,-Bdynamic -ldl
Comment by jason begley (jayray) - Thursday, 21 May 2009, 15:16 GMT
found a patch to fix it :

diff --git
index 16332a3..2cab15a 100644
@@ -632,7 +632,7 @@ else
if test "$ostype" = "AIX"; then

Thanks to Joe Shaw for the fix!
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 21 May 2009, 16:59 GMT
@Jason: libcap need to include the static version but, this patch will link to libcap as shared. I don't know what are the objetives of the packager of syslog-ng, I supose that are in reduce the number of dyn deps, this is because also glib2 is linked as static like others libs. Personally i prefer to do all shared. This bahaviour can be configured without patch.
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 28 May 2009, 19:44 GMT
Here is the patch (if maintainers accept to build as shared [#1])

* Update the latest syslog-ng 3.0.2
* Fixed the license
* Removed uid.patch, not ncessary anymore, already fixed in 3.0.2
* Fixed missing \ in configure options so the rest option was discarded.
* Added two linked flags to reduce the numbers of unused direct depends.
* Shared mode is now default in 3.0.2

Resulting binary is 238K vs 2M

$ readelf -d /usr/sbin/syslog-ng | awk '/NEEDED/{print $5}'

Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 28 May 2009, 20:11 GMT
oops add openssl to depends array i missed that!
Comment by Gerardo Exequiel Pozzi (djgera) - Friday, 10 July 2009, 05:41 GMT
Updated patch against latest version 3.0.3 for current SVN trunk.
Comment by Allan McRae (Allan) - Friday, 10 July 2009, 12:50 GMT
@Other assignees: any objections to me pushing this with djgera's PKGBUILD. Building with shared libraries does add glib2 as a dep (among other packages of less concern), which is ~10MB installed. But I think shared is better and glib2 is on 99.43% of systems according to pkgstats so I am happy with this.
Comment by Hugo Doria (hdoria) - Friday, 10 July 2009, 12:53 GMT
No problem.

Just remember to move libcap to [core]