Closed blshkv closed 7 years ago
Hmm, duk_config.h should be including
It's included for all platforms, regardless of any detection because it's an assumed header and present in C89.
Isn't [v]snprintf()
a C99 function? Maybe the C99 detection isn't working correctly.
But there's also a warning about snprintf().
According to Linux man pages both snprintf() and vsnprintf() are C89, which was my recollection too. Hopefully that's correct :)
No, actually, my bad:
snprintf(), vsnprintf(): POSIX.1-2001, POSIX.1-2008, C99.
I'll need to make a note that these are assumed to be provided, and if not provided by a C89 stdio.h, they need to be filled in via duk_config.h changes.
@blshkv Do you have -std=c99 set when you compile BTW?
Clarified (v)snprintf() dependency in #1475.
@blshkv Another question: what platform was this error found on? For Linux the duk_config.h header defines _POSIX_C_SOURCE
which then allows (v)snprintf() even without -std=c99. But _POSIX_C_SOURCE
is not currently applied on e.g. BSD platforms - so I could fix that if you let me know what platform you're compiling for.
I thought those were C99, hence why this is needed on MSVC < 2015: https://github.com/fatcerberus/minisphere/blob/v4.5.10/src/cell/posix.h#L11-L13
MSVC considered the functions "non-standard" (hence the underscore) before they got serious about C99 support. An issue Duktape itself has also had to grapple with :)
Yeah, as I said above, my bad :)
The reason this isn't an issue on Linux (which is my development OS) is that there's a _POSIX_C_SOURCE
feature define in place which allows the functions to be used even without -std=c99 (which is recommended but not always in place in application build scripts). But that define is not in place for all platforms which makes non-C99 builds complain about these symbols.
I'm facing this issue under Gentoo Linux, we just enabled all warnings using ''' - Wall'''. I'll provide more details tomorrow
@blshkv Ok, thanks. From what I can tell the _POSIX_C_SOURCE
define in duk_config.h should be enough even without -std=c99 but let's see what's causing it.
Just rechecked on Ubuntu 16.04.2 (gcc 5.4.0) that compiling with -Wall -Wextra, and without -std=c99 doesn't cause these warnings, so there must be some difference in compiler options, compiler versions, or something similar.
I was in a bed, but happy to provide more details since you are so active ;-)
* Package: dev-libs/radare2-bindings-1.3.0
* Repository: pentoo
* USE: abi_x86_64 amd64 cxx elibc_glibc kernel_linux lua perl python python_targets_python2_7 userlan
d_GNU
* FEATURES: preserve-libs sandbox userpriv usersandbox
* Package: dev-libs/radare2-bindings-1.3.0
* Repository: pentoo
* USE: abi_x86_64 amd64 cxx elibc_glibc kernel_linux lua perl python python_targets_python2_7 userlan
d_GNU
* FEATURES: preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking radare2-bindings-1.3.0.tar.gz to /var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work
>>> Source unpacked in /var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work
>>> Preparing source in /var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work/radare2-bindings-1.3.0 ...
* Applying 01_use_python_2.7.patch ... [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work/radare2-bindings-1.3.0 ...
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/
info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/radare2-bindings-1.3.0 --libdir=/
usr/lib64 --enable=cxx,lua,perl,python
==> Using valabind 0.10.0
==> Using swig 3.0.8
Checking valabind languages support...
- python: yes
- perl: yes
- ruby: yes
- lua: yes
- go: no
- java: yes
- guile: yes
- php5: no
- node-ffi: no
- ctypes: yes
- ocaml: no
- cxx: yes (g++)
- valac: no
Supported langs:
- cxx
- lua
- perl
- python
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
using crosscompilation mode.
checking for working directories... current
using prefix '/usr'
checking for c compiler... x86_64-pc-linux-gnu-gcc
checking for c++ compiler... x86_64-pc-linux-gnu-g++
checking for valabind... /usr/bin/valabind
checking for swig... /usr/bin/swig
checking for g-ir-compiler... /usr/bin/g-ir-compiler
Using PKGCONFIG: pkg-config
checking pkg-config flags for r_core... yes
creating ./config.mk
cleaning temporally files... done
Final report:
- PREFIX = /usr
- HAVE_SWIG = 1
- HAVE_VALABIND = 1
- HAVE_GIRCOMPILER = 1
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work/radare2-bindings-1.3.0 ...
make -j2
make -C libr/lang/p
make[1]: Entering directory '/var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work/radare2-bindings-1.3.0/libr/lang/p'
cc -Os -mtune=nocona -pipe -frecord-gcc-switches -I/usr/include/libr -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua
52 -I/usr/include/texluajit -c -o lua.o lua.c
cc -Os -mtune=nocona -pipe -frecord-gcc-switches -I/usr/include/libr -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua
52 -I/usr/include/texluajit -I/usr/lib64/perl5/5.22.3/x86_64-linux/CORE/ \
-fPIC -lr_core -lr_io -lr_util -shared -o lang_perl.so perl.c \
`perl -MExtUtils::Embed -e ccopts | sed -e 's/-arch [^\s]* //g'` \
`perl -MExtUtils::Embed -e ldopts | sed -e 's/-arch [^\s]* //g'`
cc python.c -Os -mtune=nocona -pipe -frecord-gcc-switches -I/usr/include/libr -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/inclu
de/texlua52 -I/usr/include/texluajit -I/usr/include/python2.7 -I/usr/include/python2.7 -Os -mtune=nocona -pipe -frecord-gcc
-switches -fwrapv -DNDEBUG -lpython2.7 -lpthread -ldl -lutil -lm -L/usr/lib -lr_core -lr_io -lr_util -shared \
-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -lr_core -lr_io -lr_util -shared -fPIC -o lang_python.so
perl.c: In function ‘setup’:
perl.c:77:2: warning: #warning TODO: implement setup in lang/perl [-Wcpp]
#warning TODO: implement setup in lang/perl
^
cc -fPIC -lr_core -lr_io -lr_util -shared -o lang_csharp.so \
-I/usr/include/libr -lr_util csharp.c
cc -Os -mtune=nocona -pipe -frecord-gcc-switches -I/usr/include/libr -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua
52 -I/usr/include/texluajit -c -o duktape.o duktape.c
In file included from duktape.c:12:0:
duk_error_macros.c: In function ‘duk_err_handle_error_fmt’:
duk_error_macros.c:15:2: warning: implicit declaration of function ‘vsnprintf’ [-Wimplicit-fu
nction-declaration]
In file included from duktape.c:12:0:
duk_bi_date.c: In function ‘duk__format_parts_iso8601’:
duk_bi_date.c:967:2: warning: implicit declaration of function ‘snprintf’ [-Wimplicit-functio
n-declaration]
In file included from ./duk/duktape.h:142:0,
from duk_internal.h:26,
from duktape.c:12:
./duk/duk_config.h:2027:26: warning: incompatible implicit declaration of built-in function ‘snpr
intf’
#define DUK_SNPRINTF snprintf
^
duk_bi_date.c:967:2: note: in expansion of macro ‘DUK_SNPRINTF’
duk_bi_date_unix.c: In function ‘duk_bi_date_parse_string_strptime’:
./duk/duk_config.h:2027:26: warning: incompatible implicit declaration of built-in function ‘snpr
intf’
#define DUK_SNPRINTF snprintf
^
duk_bi_date_unix.c:206:2: note: in expansion of macro ‘DUK_SNPRINTF’
duk_bi_json.c: In function ‘duk__enc_pointer’:
./duk/duk_config.h:2027:26: warning: incompatible implicit declaration of built-in function ‘snpr
intf’
#define DUK_SNPRINTF snprintf
^
duk_bi_json.c:1600:2: note: in expansion of macro ‘DUK_SNPRINTF’
duk_error_longjmp.c: In function ‘duk__uncaught_error_aware’:
./duk/duk_config.h:2027:26: warning: incompatible implicit declaration of built-in function ‘snpr
intf’
#define DUK_SNPRINTF snprintf
^
duk_error_longjmp.c:33:2: note: in expansion of macro ‘DUK_SNPRINTF’
duk_heap_stringtable.c: In function ‘duk_heap_string_intern_u32’:
./duk/duk_config.h:2027:26: warning: incompatible implicit declaration of built-in function ‘snpr
intf’
#define DUK_SNPRINTF snprintf
^
duk_heap_stringtable.c:997:2: note: in expansion of macro ‘DUK_SNPRINTF’
cc -Os -mtune=nocona -pipe -frecord-gcc-switches -I/usr/include/libr -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua
52 -I/usr/include/texluajit -fPIC -lr_core -lr_io -lr_util -shared -o lang_lua.so lua.c -ltexlua52 -ltexluajit -llua -lm
cc -std=c99 -Os -mtune=nocona -pipe -frecord-gcc-switches -I/usr/include/libr -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/inclu
de/texlua52 -I/usr/include/texluajit -fPIC -lr_core -lr_io -lr_util -shared \
-o lang_duktape.so duktape.c
LANG lang_lua.so lang_perl.so lang_python.so lang_csharp.so lang_duktape.so
make[1]: Leaving directory '/var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work/radare2-bindings-1.3.0/libr/lang/p'
make[1]: Entering directory '/var/tmp/portage/dev-libs/radare2-bindings-1.3.0/work/radare2-bindings-1.3.0/cxx'
emerge --info
Portage 2.3.3 (python 2.7.12-final-0, hardened/linux/amd64, gcc-4.9.4, glibc-2.23-r3, 4.7.10-pentoo x86_64)
=================================================================
System uname: Linux-4.7.10-pentoo-x86_64-Intel-R-_Core-TM-_i5-3320M_CPU_@_2.60GHz-with-gentoo-2.3
KiB Mem: 4046688 total, 3538764 free
KiB Swap: 4039676 total, 4039676 free
Timestamp of repository gentoo: Mon, 10 Apr 2017 07:15:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
app-shells/bash: 4.3_p48-r1::gentoo
dev-java/java-config: 2.2.0-r3::gentoo
dev-lang/perl: 5.22.3_rc4::gentoo
dev-lang/python: 2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake: 3.7.2::gentoo
sys-apps/baselayout: 2.3::gentoo
sys-apps/openrc: 0.23.2::gentoo
sys-apps/sandbox: 2.10-r3::gentoo
sys-devel/autoconf: 2.13::gentoo, 2.69::gentoo
sys-devel/automake: 1.15::gentoo
sys-devel/binutils: 2.26.1::gentoo
sys-devel/gcc: 4.9.4::gentoo
sys-devel/gcc-config: 1.7.3::gentoo
sys-devel/libtool: 2.4.6-r3::gentoo
sys-devel/make: 4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc: 2.23-r3::gentoo
Repositories:
gentoo
location: /usr/portage
sync-type: rsync
sync-uri: rsync://rsync.jp.gentoo.org/gentoo-portage
priority: -1000
pentoo
location: /var/lib/layman/pentoo
masters: gentoo
priority: 50
ABI="amd64"
ABI_X86="64 32"
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x Intel-SDP google-chrome"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
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"
ANT_HOME="/usr/share/ant"
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"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode internal-glib python_targets_python3_4 python_targets_python2_7 multilib hardened pax_kernel pic xtpax -jit -orc multilib"
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -mtune=nocona -pipe -frecord-gcc-switches"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CPU_FLAGS_X86="mmx mmxext sse sse2"
CXXFLAGS="-Os -mtune=nocona -pipe -frecord-gcc-switches"
DEFAULT_ABI="amd64"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS=" --ask-enter-invalid --keep-going=y --binpkg-respect-use=y --tree --verbose --with-bdeps=y --autounmask=n --buildpkg-exclude "sys-kernel/compat-drivers sys-kernel/ax88179_178a x11-drivers/ati-drivers x11-drivers/nvidia-drivers sys-fs/zfs-kmod sys-kernel/spl sys-power/bbswitch pentoo/pentoo-installer x11-drivers/xf86-video-virtualbox app-emulation/virtualbox-guest-additions app-emulation/virtualbox-modules app-emulation/vmware-modules app-emulation/open-vm-tools sys-kernel/genkernel dev-python/certifi sys-kernel/pentoo-sources dev-python/twisted-web net-analyzer/metasploit sci-libs/lapack-reference x11-base/xorg-drivers app-admin/genmenu" --usepkg-exclude "sys-kernel/compat-drivers sys-kernel/ax88179_178a x11-drivers/ati-drivers x11-drivers/nvidia-drivers sys-fs/zfs-kmod sys-kernel/spl sys-power/bbswitch pentoo/pentoo-installer x11-drivers/xf86-video-virtualbox app-emulation/virtualbox-guest-additions app-emulation/virtualbox-modules app-emulation/vmware-modules app-emulation/open-vm-tools sys-kernel/genkernel dev-python/certifi sys-kernel/pentoo-sources dev-python/twisted-web net-analyzer/metasploit sci-libs/lapack-reference x11-base/xorg-drivers app-admin/genmenu" --binpkg-changed-deps=y"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-Os -mtune=nocona -pipe -frecord-gcc-switches"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port= ; eval \"declare -a ssh_opts=(\${3})\" ; exec sftp \${port:+-P \${port}} \"\${ssh_opts[@]}\" \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port= ; exec rsync --rsh=\"ssh \${port:+-p\${port}} \${3}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
FFLAGS="-Os -mtune=nocona -pipe -frecord-gcc-switches"
FLTK_DOCDIR="/usr/share/doc/fltk-1.3.3-r3/html"
GCC_SPECS=""
GENTOO_MIRRORS="http://gentoo.gg3.net"
GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx"
GRUB_PLATFORMS="coreboot efi-32 efi-64 emu multiboot pc qemu"
GSETTINGS_BACKEND="dconf"
GUILE_LOAD_PATH="/usr/share/guile/1.8"
HOME="/home/blshkv"
INFOPATH="/usr/share/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.4/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.26.1/info"
INPUT_DEVICES="evdev keyboard mouse synaptics"
INSTALL_MASK="/usr/lib/debug"
IUSE_IMPLICIT="abi_x86_64 prefix prefix-guest"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LC_CTYPE="ru_RU.utf8"
LC_MESSAGES="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LDFLAGS_amd64="-m elf_x86_64"
LDFLAGS_x32="-m elf32_x86_64"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe %s"
LIBDIR_amd64="lib64"
LIBDIR_x32="libx32"
LIBDIR_x86="lib32"
LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
LOGNAME="blshkv"
LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.cfg=00;32:*.conf=00;32:*.diff=00;32:*.doc=00;32:*.ini=00;32:*.log=00;32:*.patch=00;32:*.pdf=00;32:*.ps=00;32:*.tex=00;32:*.txt=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:"
MAIL="/var/mail/blshkv"
MAKEOPTS="-j2"
MANPAGER="manpager"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.9.4/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.26.1/man:/etc/java-config-2/current-system-vm/man/:/usr/share/postgresql/man/:/usr/share/postgresql-9.5/man/"
MSF_DATABASE_CONFIG="/usr/lib/metasploit/config/database.yml"
MSF_LOCAL_LIB="/usr/lib/metasploit/lib/metasm"
MSF_ROOT="/usr/lib/metasploit"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev|systemd|clang|python-exec|llvm)"
MULTIOSDIRS="../lib64:../lib32"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
OFFICE_IMPLEMENTATION="libreoffice"
OLDPWD="/var/tmp/portage/dev-libs/radare2-bindings-1.3.0/temp"
OPENCL_PROFILE="nvidia"
OPENGL_PROFILE="xorg-x11"
PAGER="/usr/bin/less"
PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.4"
PENTOO_BINPKG_RESTRICTED="sys-kernel/compat-drivers sys-kernel/ax88179_178a x11-drivers/ati-drivers x11-drivers/nvidia-drivers sys-fs/zfs-kmod sys-kernel/spl sys-power/bbswitch pentoo/pentoo-installer x11-drivers/xf86-video-virtualbox app-emulation/virtualbox-guest-additions app-emulation/virtualbox-modules app-emulation/vmware-modules app-emulation/open-vm-tools sys-kernel/genkernel dev-python/certifi sys-kernel/pentoo-sources dev-python/twisted-web net-analyzer/metasploit sci-libs/lapack-reference x11-base/xorg-drivers app-admin/genmenu"
PHP_TARGETS="php5-6"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="alpha amd64 amd64-fbsd amd64-linux arm arm-linux arm64 arm64-linux hppa ia64 m68k m68k-mint mips nios2 ppc ppc-aix ppc-macos ppc64 ppc64-linux riscv s390 sh sparc sparc-fbsd sparc-solaris sparc64-solaris x64-cygwin x64-macos x64-solaris x86 x86-cygwin x86-fbsd x86-linux x86-macos x86-solaris x86-winnt"
PORTAGE_BINHOST="http://mirror.switch.ch/ftp/mirror/pentoo/Packages/amd64-hardened"
PORTAGE_BIN_PATH="/usr/lib/portage/python2.7"
PORTAGE_BZIP2_COMMAND="lbzip2"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error qa"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA256 --clearsign --yes --default-key "${PORTAGE_GPG_KEY}" --homedir "${PORTAGE_GPG_DIR}" "${FILE}""
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_INTERNAL_CALLER="1"
PORTAGE_IO_NICENESS="ionice -c 3 -p ${PID}"
PORTAGE_NICENESS="9"
PORTAGE_OVERRIDE_EPREFIX=""
PORTAGE_PYM_PATH="/usr/lib64/python2.7/site-packages"
PORTAGE_PYTHONPATH="/usr/lib64/python2.7/site-packages"
PORTAGE_RSYNC_EXTRA_OPTS="--omit-dir-times"
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_RSYNC_RETRIES="-1"
PORTAGE_SYNC_STALE="30"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTAGE_XATTR_EXCLUDE="btrfs.* security.evm security.ima security.selinux system.nfs4_acl"
PORT_LOGDIR_CLEAN="find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +7 -delete"
PROFILE_IS_HARDENED="1"
PROFILE_ONLY_VARIABLES="ARCH ELIBC IUSE_IMPLICIT KERNEL USERLAND USE_EXPAND_IMPLICIT USE_EXPAND_UNPREFIXED USE_EXPAND_VALUES_ARCH USE_EXPAND_VALUES_ELIBC USE_EXPAND_VALUES_KERNEL USE_EXPAND_VALUES_USERLAND"
PWD="/home/blshkv"
PYTHONDONTWRITEBYTECODE="1"
PYTHON_SINGLE_TARGET="python2_7"
PYTHON_TARGETS="python2_7 python3_4"
QEMU_SOFTMMU_TARGETS="arm aarch64 i386 x86_64"
QEMU_USER_TARGETS="arm aarch64 i386 x86_64"
QT_GRAPHICSSYSTEM="raster"
RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
RESUMECOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
RESUMECOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port= ; exec rsync --rsh=\"ssh \${port:+-p\${port}} \${3}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.4"
RPMDIR="/usr/portage/rpm"
RUBY_TARGETS="ruby21"
SHELL="/bin/bash"
SHLVL="1"
SSH_CLIENT="10.0.2.2 43302 22"
SSH_CONNECTION="10.0.2.2 43302 10.0.2.15 22"
SSH_TTY="/dev/pts/2"
SYMLINK_LIB="yes"
TERM="xterm"
UNINSTALL_IGNORE="/lib/modules/* /var/run /var/lock"
USE="X a52 aac acl acpi adns alsa amd64 berkdb branding bzip2 cairo caps cdda cdr cli consolekit cracklib crypt cups curl cxx dbus directfb dri dts dvd dvdr emboss encode exif fam fbcon firefox flac fortran gdbm gif glamor gpm gps gtk hardened iconv ipv6 jack jpeg justify lcms ldap libnotify lm_sensors lua lzma mad minipentoo mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp orc oss pam pango pax_kernel pcre pdf pentoo perl pie png policykit ppds pulseaudio python qt3support qt4 readline ruby samba sdl seccomp session spell sqlite ssl ssp startup-notification subversion svg tcpd tiff truetype udev udisks unicode upower urandom usb vorbis wxwidgets x264 xattr xcb xinerama xml xtpax xv xvid zlib" ABI_X86="64 32" 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="coreboot efi-32 efi-64 emu multiboot pc qemu" INPUT_DEVICES="evdev keyboard mouse synaptics" 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" QEMU_SOFTMMU_TARGETS="arm aarch64 i386 x86_64" QEMU_USER_TARGETS="arm aarch64 i386 x86_64" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="vesa vga fbdev virtualbox" XFCE_PLUGINS="brightness menu logout trash" 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"
USER="blshkv"
USERLAND="GNU"
USE_EXPAND="ABI_MIPS ABI_PPC ABI_S390 ABI_X86 ALSA_CARDS APACHE2_MODULES APACHE2_MPMS CALLIGRA_EXPERIMENTAL_FEATURES CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS COMPAT_DRIVERS_ETHERNET COMPAT_DRIVERS_VARIOUS COMPAT_DRIVERS_WIFI CPU_FLAGS_ARM CPU_FLAGS_X86 CROSSCOMPILE_OPTS CURL_SSL ELIBC ENLIGHTENMENT_MODULES FFTOOLS GPSD_PROTOCOLS GRUB_PLATFORMS INPUT_DEVICES KERNEL L10N LCD_DEVICES LIBREOFFICE_EXTENSIONS LINGUAS LIRC_DEVICES LLVM_TARGETS MONKEYD_PLUGINS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL NGINX_MODULES_STREAM OFED_DRIVERS OFFICE_IMPLEMENTATION OPENMPI_FABRICS OPENMPI_OFED_FEATURES OPENMPI_RM PHP_TARGETS PYTHON_SINGLE_TARGET PYTHON_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS ROS_MESSAGES RUBY_TARGETS SANE_BACKENDS UNICORN_TARGETS USERLAND UWSGI_PLUGINS VIDEO_CARDS VOICEMAIL_STORAGE XFCE_PLUGINS XTABLES_ADDONS"
USE_EXPAND_HIDDEN="ABI_MIPS ABI_PPC ABI_S390 CPU_FLAGS_ARM CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_EXPAND_IMPLICIT="ARCH ELIBC KERNEL USERLAND"
USE_EXPAND_UNPREFIXED="ARCH"
USE_EXPAND_VALUES_ARCH="alpha amd64 amd64-fbsd amd64-linux arm arm-linux arm64 hppa ia64 m68k m68k-mint mips nios2 ppc ppc64 ppc64-linux ppc-aix ppc-macos riscv s390 sh sparc sparc64-solaris sparc-fbsd sparc-solaris x64-cygwin x64-macos x64-solaris x86 x86-cygwin x86-fbsd x86-linux x86-macos x86-solaris x86-winnt"
USE_EXPAND_VALUES_ELIBC="AIX bionic Cygwin Darwin DragonFly FreeBSD glibc HPUX Interix mingw mintlib musl NetBSD OpenBSD SunOS uclibc Winnt"
USE_EXPAND_VALUES_KERNEL="AIX Darwin FreeBSD freemint HPUX linux NetBSD OpenBSD SunOS Winnt"
USE_EXPAND_VALUES_USERLAND="BSD GNU"
USE_ORDER="env:pkg:conf:defaults:pkginternal:repo:env.d"
VIDEO_CARDS="vesa vga fbdev virtualbox"
XDG_CONFIG_DIRS="/etc/xdg"
XDG_DATA_DIRS="/usr/local/share:/usr/share"
XDG_RUNTIME_DIR="/var/run/user/1002"
XDG_SESSION_COOKIE="itdefence-1491926022.513021-817519049"
XFCE_PLUGINS="brightness menu logout trash"
XSESSION="Xfce4"
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"
Thanks, I tried to replicate the exact options to gcc (and clang) but failed to reproduce on Ubuntu. So I'm not sure why that _POSIX_C_SOURCE
wouldn't get applied. Could you print out Duktape.env
(if that's easy) from a script, it might shed light on whether the platform wasn't detected as Linux for some reason (that would seem odd).
Also, it would be good if you could try -std=c99 on that compile line to see if it fixes the issue. If so, there's something weird going on between the feature defines and header inclusion.
ok, the -std=c99 fixes the error, however I can not reproduce the issue on a difference system with 5.4.0 compiler.
I could try to reproduce by installing a Gentoo VM? Or was that different system also Gentoo?
The issue I'm facing is under vm (gcc 4.9.4) and that difference system is a Gentoo host with almost exactly the same setup. I will install gcc 5.4.0 on that vm tomorrow and report back.
Thanks, very much appreciated.
ok, so I have upgraded gcc to v5.4.0 and the error is gone. I guess we can close the issue
Ok, would have been nice to know the root cause but maybe it's not worth investigating more :)
yeah, I'm puzzled myself was it false positive or false negative. But I have no time for further investigation
No worries, I understand, time is a scarce resource for me too :)
https://github.com/radare/radare2-bindings/issues/155