<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>180619</bug_id>
          
          <creation_ts>2007-06-02 09:38 0000</creation_ts>
          <short_desc>sys-block/iscsitarget-0.4.15 fails to compile on gcc-3.4.x (hardened)</short_desc>
          <delta_ts>2008-02-22 03:35:20 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>natanael.copa@gmail.com</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>natanael.copa@gmail.com</who>
            <bug_when>2007-06-02 09:38:58 0000</bug_when>
            <thetext>&gt;&gt;&gt; Compiling source in /var/tmp/portage/sys-block/iscsitarget-0.4.15/work/iscsitarget-0.4.15 ...
 * Building userspace
gcc: /lib/modules/2.6.21-gentoo-r1/build/include/linux/version.h: No such file or directory
gcc: no input files
/bin/sh: line 0: [: -le: unary operator expected
/bin/sh: line 0: [: -lt: unary operator expected
make -C usr
make[1]: Entering directory `/var/tmp/portage/sys-block/iscsitarget-0.4.15/work/iscsitarget-0.4.15/usr&apos;
cc  -march=i386 -Os -pipe -fomit-frame-pointer -Wall -Wstrict-prototypes -I../include   -c -o ietd.o ietd.c
cc  -march=i386 -Os -pipe -fomit-frame-pointer -Wall -Wstrict-prototypes -I../include   -c -o iscsid.o iscsid.c

...

cc  -march=i386 -Os -pipe -fomit-frame-pointer -Wall -Wstrict-prototypes -I../include   -c -o plain.o plain.c
cc  -march=i386 -Os -pipe -fomit-frame-pointer -Wall -Wstrict-prototypes -I../include   -c -o isns.o isns.c
isns.c: In function `isns_scn_register&apos;:
isns.c:259: error: syntax error before &apos;{&apos; token
isns.c:259: warning: unused variable `__v&apos;
isns.c:259: error: syntax error before &quot;__v&quot;
isns.c:231: warning: unused variable `err&apos;
isns.c:232: warning: unused variable `flags&apos;
isns.c: At top level:
isns.c:259: error: syntax error before &apos;)&apos; token
isns.c:259: warning: type defaults to `int&apos; in declaration of `scn_flags&apos;
isns.c:259: error: initializer element is not constant
isns.c:259: warning: data definition has no type or storage class
isns.c:259: warning: type defaults to `int&apos; in declaration of `scn_flags&apos;
isns.c:259: error: redefinition of &apos;scn_flags&apos;
isns.c:259: error: previous definition of &apos;scn_flags&apos; was here
isns.c:259: error: initializer element is not constant

...

isns.c:267: error: initializer element is not constant
isns.c:267: warning: data definition has no type or storage class
isns.c:268: error: syntax error before &quot;if&quot;
make[1]: *** [isns.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/sys-block/iscsitarget-0.4.15/work/iscsitarget-0.4.15/usr&apos;
make: *** [usr] Error 2

!!! ERROR: sys-block/iscsitarget-0.4.15 failed.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>natanael.copa@gmail.com</who>
            <bug_when>2007-06-02 09:39:28 0000</bug_when>
            <thetext>emerge --info:

Portage 2.1.2.7 (uclibc/x86/hardened, gcc-3.4.6, uclibc-0.9.28.3-r0, 2.6.21-gentoo-r1 i686)
=================================================================
System uname: 2.6.21-gentoo-r1 i686 Intel(R) Pentium(R) D CPU 3.00GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 01 Jun 2007 07:30:01 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61
sys-devel/automake:  1.6.3, 1.8.5-r3, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i386-gentoo-linux-uclibc&quot;
CFLAGS=&quot;-march=i386 -Os -pipe -fomit-frame-pointer&quot;
CHOST=&quot;i386-gentoo-linux-uclibc&quot;
CONFIG_PROTECT=&quot;/etc&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/terminfo&quot;
CXXFLAGS=&quot;-Os -pipe&quot;
DISTDIR=&quot;/var/cache/distfiles&quot;
FEATURES=&quot;autoconfig buildpkg distlocks metadata-transfer nodoc noinfo noman sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo&quot;
MAKEOPTS=&quot;-j3&quot;
PKGDIR=&quot;/var/cache/packages/default&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/alpine-portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;X509 bitmap-fonts bri bzip2 cli cracklib dri encode expat extensions hardened iproute2 ipv6 jpeg lua mad midi mudflap ncurses netboot nonfsv4 ntfs ogg openmp oss pci pcmcia pic png pppd pri readline reflection rrdtool sensord session snmp speex spl ssl tdb truetype truetype-fonts type1-fonts uclibc uclibc++ udev usb userlocales wifi wordexp x86 xorg zaptel zlib&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;uclibc&quot; INPUT_DEVICES=&quot;keyboard mouse evdev&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; MISDN_CARDS=&quot;avmfritz hfcmulti hfcpci hfcsmini hfcsusb netjetpci sedlfax w6692pci xhfc&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;dummy fbdev v4l apm ark chips cirrus cyrix epson glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng vesa vga via voodoo&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>natanael.copa@gmail.com</who>
            <bug_when>2007-06-02 09:41:09 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; &gt;&gt;&gt; Compiling source in /var/tmp/portage/sys-block/iscsitarget-0.4.15/work/iscsitarget-0.4.15 ...
&gt;  * Building userspace
&gt; gcc: /lib/modules/2.6.21-gentoo-r1/build/include/linux/version.h: No such file
&gt; or directory
&gt; gcc: no input files
&gt; /bin/sh: line 0: [: -le: unary operator expected
&gt; /bin/sh: line 0: [: -lt: unary operator expected


FYI. Those comes from the fact that I compile in an uclibc chroot. I can work around the messages by setting KSRC=/usr/src/linux.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>natanael.copa@gmail.com</who>
            <bug_when>2007-06-14 12:55:36 0000</bug_when>
            <thetext>The problem has to do with my gcc-3.4.6 compiler version and not uclibc.

First is set_scn_flag(x) defined:

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define set_scn_flag(x)                                         \
{                                                               \
        x = (x &amp; 0x55555555) &lt;&lt; 1 | (x &amp; 0xaaaaaaaa) &gt;&gt; 1;      \
        x = (x &amp; 0x33333333) &lt;&lt; 2 | (x &amp; 0xcccccccc) &gt;&gt; 2;      \
        x = (x &amp; 0x0f0f0f0f) &lt;&lt; 4 | (x &amp; 0xf0f0f0f0) &gt;&gt; 4;      \
        x = (x &amp; 0x00ff00ff) &lt;&lt; 8 | (x &amp; 0xff00ff00) &gt;&gt; 8;      \
        x = (x &amp; 0x0000ffff) &lt;&lt; 16 | (x &amp; 0xffff0000) &gt;&gt; 16;    \
}
#else
#define set_scn_flag(x) (x)
#endif

Later this code appears:
	scn_flags = ISNS_SCN_FLAG_INITIATOR | ISNS_SCN_FLAG_OBJECT_REMOVE |
		ISNS_SCN_FLAG_OBJECT_ADDED | ISNS_SCN_FLAG_OBJECT_UPDATED;
	scn_flags = htonl(set_scn_flag(scn_flags));

If i understand that correctly gcc-3.4.6 will expand it as:

  scn_flags = htonl( { scn_flags  = (scn_flags &amp; 0x55555555) &lt;&lt; 1 | ... ; ... } );

which is invaild.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>natanael.copa@gmail.com</who>
            <bug_when>2007-06-14 13:35:22 0000</bug_when>
            <thetext>Created an attachment (id=122028)
files/iscsitarget-0.4.15-gcc-3.4-fix.patch

makes it compile on gcc-3.4</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rentorbuy@yahoo.com</who>
            <bug_when>2007-08-15 09:39:05 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; files/iscsitarget-0.4.15-gcc-3.4-fix.patch
&gt; makes it compile on gcc-3.4

iscsitarget 0.4.15 emerged without errors on:

# emerge --info
Portage 2.1.2.9 (hardened/x86/2.6, gcc-3.4.6, glibc-2.5-r4, 2.6.20-hardened-r5 i686)
=================================================================
System uname: 2.6.20-hardened-r5 i686 Pentium III (Coppermine)
Gentoo Base System release 1.12.9
Timestamp of tree: Thu, 26 Jul 2007 08:00:02 +0000
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-march=i686 -mtune=pentium3 -O2 -pipe -fforce-addr&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/lib/fax /var/spool/fax/etc&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo&quot;
CXXFLAGS=&quot;-march=i686 -mtune=pentium3 -O2 -pipe -fforce-addr&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;distlocks metadata-transfer sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://mirror.ovh.net/gentoo-distfiles/&quot;
LANG=&quot;es_ES.UTF-8@euro&quot;
LC_ALL=&quot;&quot;
LINGUAS=&quot;es&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;7zip acl apache2 berkdb bzip2 cracklib crypt cups extensions hardened iconv jbig jpeg jpeg2k kerberos ldap midi ncurses nls nptl nptlonly pam php pic png ppds readline samba ssl tcpd tiff urandom winbind x86 xorg zip zlib&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;mouse keyboard&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; LINGUAS=&quot;es&quot; USERLAND=&quot;GNU&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

I didn&apos;t try it with a kernel v. &gt; 2.6.20.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rentorbuy@yahoo.com</who>
            <bug_when>2007-08-15 09:40:30 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; iscsitarget 0.4.15 emerged without errors

That is, without the iscsitarget-0.4.15-gcc-3.4-fix.patch file.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rentorbuy@yahoo.com</who>
            <bug_when>2007-08-15 09:43:01 0000</bug_when>
            <thetext>(In reply to comment #5)

Sorry for the mess. Not using uclibc... </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-02-22 03:20:49 0000</bug_when>
            <thetext>please try changing the macro to read:
#define set_scn_flag(x) ({ .... })

in other words, just add the parens before/after the braces</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-02-22 03:35:20 0000</bug_when>
            <thetext>hmm it&apos;ll fail to build even with gcc-4.x if you use -O0

added the fix i proposed to cvs

http://sources.gentoo.org/sys-block/iscsitarget/iscsitarget-0.4.15-r1.ebuild?r1=1.2&amp;r2=1.3
http://sources.gentoo.org/sys-block/iscsitarget/files/iscsitarget-0.4.15-isns-set-scn-flag.patch?rev=1.1</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>122028</attachid>
            <date>2007-06-14 13:35 0000</date>
            <desc>files/iscsitarget-0.4.15-gcc-3.4-fix.patch</desc>
            <filename>iscsitarget-0.4.15-gcc-3.4-fix.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGlzY3NpdGFyZ2V0LTAuNC4xNS91c3IvaXNucy5jLm9yaWcJMjAwNy0wNi0xNCAxMzoxNzo0
NCArMDAwMAorKysgaXNjc2l0YXJnZXQtMC40LjE1L3Vzci9pc25zLmMJMjAwNy0wNi0xNCAxMzox
ODozOSArMDAwMApAQCAtMjU2LDcgKzI1Niw4IEBACiAKIAlzY25fZmxhZ3MgPSBJU05TX1NDTl9G
TEFHX0lOSVRJQVRPUiB8IElTTlNfU0NOX0ZMQUdfT0JKRUNUX1JFTU9WRSB8CiAJCUlTTlNfU0NO
X0ZMQUdfT0JKRUNUX0FEREVEIHwgSVNOU19TQ05fRkxBR19PQkpFQ1RfVVBEQVRFRDsKLQlzY25f
ZmxhZ3MgPSBodG9ubChzZXRfc2NuX2ZsYWcoc2NuX2ZsYWdzKSk7CisJc2V0X3Njbl9mbGFnKHNj
bl9mbGFncyk7CisJc2NuX2ZsYWdzID0gaHRvbmwoc2NuX2ZsYWdzKTsKIAogCWxlbmd0aCArPSBp
c25zX3Rsdl9zZXQoJnRsdiwgSVNOU19BVFRSX0lTQ1NJX1NDTl9CSVRNQVAsCiAJCQkgICAgICAg
c2l6ZW9mKHNjbl9mbGFncyksICZzY25fZmxhZ3MpOwo=
</data>        

          </attachment>
    </bug>

</bugzilla>