Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 594586

Summary: net-misc/sslh-1.18-r1 common.c:603:59: error: ‘VERSION’ undeclared
Product: Gentoo Linux Reporter: Anton Bolshakov <anton.bugs>
Component: Current packagesAssignee: Michael Palimaka (kensington) <kensington>
Status: RESOLVED FIXED    
Severity: normal CC: candrews
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
Patch for testing

Description Anton Bolshakov 2016-09-21 08:46:20 UTC
Created attachment 447028 [details]
build.log

./genver.sh >version.h
x86_64-pc-linux-gnu-gcc -O2 -pipe -DLIBWRAP -DENABLE_REGEX -DLIBCONFIG -c common.c
x86_64-pc-linux-gnu-gcc -O2 -pipe -DLIBWRAP -DENABLE_REGEX -DLIBCONFIG -c sslh-main.c
x86_64-pc-linux-gnu-gcc -O2 -pipe -DLIBWRAP -DENABLE_REGEX -DLIBCONFIG -c probe.c
common.c: In function ‘check_access_rights’:
common.c:552:20: warning: passing argument 1 of ‘hosts_ctl’ discards ‘const’ qualifier from pointer target type
     if (!hosts_ctl(service, host, addr_str, STRING_UNKNOWN)) {
                    ^
In file included from common.c:43:0:
/usr/include/tcpd.h:121:12: note: expected ‘char *’ but argument is of type ‘const char *’
 extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
            ^
common.c: In function ‘setup_syslog’:
common.c:603:59: error: ‘VERSION’ undeclared (first use in this function)
     log_message(LOG_INFO, "%s %s started\n", server_type, VERSION);
                                                           ^
common.c:603:59: note: each undeclared identifier is reported only once for each function it appears in
sslh-main.c:40:9: error: expected ‘,’ or ‘;’ before ‘VERSION’
 "sslh " VERSION "\n" \


emerge --info
Portage 2.2.28 (python 2.7.10-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.22-r4, 3.11.0-cloud x86_64)
=================================================================
System uname: Linux-3.11.0-cloud-x86_64-Intel-R-_Xeon-R-_CPU_E5-2640_0_@_2.50GHz-with-gentoo-2.2
KiB Mem:     2043604 total,    490852 free
KiB Swap:     506040 total,    404820 free
Timestamp of repository gentoo: Wed, 21 Sep 2016 05:30:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-lang/perl:            5.22.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.3::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

local-overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 0

pentoo
    location: /var/lib/layman/pentoo
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran fpm gdbm iconv ipv6 mmx mmxext modules multilib mysql ncurses nls nptl openmp pam pcre php readline seccomp session sqlite sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21" USERLAND="GNU" UWSGI_PLUGINS="cache carbon cheaper_busyness corerouter fastrouter http logfile logsocket mongodblog nagios ping rawrouter redislog router_basicauth router_cache router_expires router_hash router_http router_memcached router_metrics router_redirect router_redis router_rewrite router_static router_uwsgi rpc signal spooler sslrouter symcall syslog transformation_chunked transformation_gzip transformation_offload transformation_tofile ugreen zergpool" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Felix Janda 2016-09-21 11:54:24 UTC
This is a problem with upstream's Makefile. Gentoo has two patches trying
to fix it (also sent upstream https://github.com/yrutschle/sslh/pull/97),
but as this bug shows they don't quite suffice.

The problem is that suffix rules cannot specify dependencies. So make will
not know that common.c depends on version.h, generates version.h in
parallel to common.o, and fails compilation of common.o because version.h
is still empty.
Comment 2 Felix Janda 2016-09-21 11:57:20 UTC
Created attachment 447032 [details, diff]
Patch for testing

This patch can be put into /etc/portage/patches/net-misc/sslh/make.patch
for testing. For the portage tree it would be better to clean up the
existing patches.
Comment 3 Anton Bolshakov 2016-09-22 06:56:52 UTC
I've managed to compile it with the patch. Thank you.

You should probably increase the priority of this bug since it affects the stable version
Comment 4 Michael Palimaka (kensington) gentoo-dev 2016-09-22 09:31:48 UTC
@candrews, FYI wrt your PR
Comment 5 Michael Palimaka (kensington) gentoo-dev 2016-09-22 09:45:54 UTC
By the way, the difficulty (for me at least) in fixing this so far is it's been difficult to reproduce reliably.

With candrews' patch I haven't been able to reproduce since, and prior to that only sporadically.
Comment 6 dwfreed 2016-09-22 09:54:49 UTC
https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html

> Suffix rules cannot have any prerequisites of their own. If they have any, they are treated as normal files with funny names, not as suffix rules.

You could verify this by doing ebuild sslh-1.18-r1.ebuild configure, then cd into $S and doing 'make common.o' and watch it all fall apart.  This will fix the dependencies properly:

%.o: %.c *.h version.h
Comment 7 Felix Janda 2016-09-22 11:31:45 UTC
@kensington: By doing "make -j" (no number after "-j", i.e. use as many
processes as possible), possibly several times, it is usually easy to
reproduce parallel make issues.

@dwfree: Your fix does not quite correspond to the rest of your comment...
Comment 8 Michael Palimaka (kensington) gentoo-dev 2016-09-22 16:32:59 UTC
Thanks, new patch added in git.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=430ffc3b9d61a40ff807dfd534f4333aeae8198c

Hopefully this solves it for real this time!