Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 362037 - sys-process/audit-1.7.4: fails to build with gcc-4.6.0
Summary: sys-process/audit-1.7.4: fails to build with gcc-4.6.0
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-4.6 418395
  Show dependency tree
 
Reported: 2011-04-05 10:28 UTC by Anthony Basile
Modified: 2012-07-03 19:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
update mode_t to rmode_t for gcc-4.6 (audit-1.7.4-gcc46.patch,698 bytes, patch)
2011-04-07 00:28 UTC, Jory A. Pratt
Details | Diff
change mode_t to rmode_t via sed (audit-1.7.4-gcc46-support.patch,642 bytes, patch)
2011-04-10 13:45 UTC, Jory A. Pratt
Details | Diff
Log file (sys-process:audit-1.7.4:20110424-224628.log,36.11 KB, text/plain)
2011-04-25 01:18 UTC, taaroa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2011-04-05 10:28:08 UTC
Jory and I both hit this.  On both the default amd64 profile or hardened-multilib, audit fails to build with gcc-4.6.0.  It fails with a redefinition of typedef mode_t.

autrace.c:210:5: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
/bin/sh ../libtool --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -D_REENTRANT -D_GNU_SOURCE -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o autrace autrace.o delete_all.o auditctl-llist.o -lpthread -Lmt -lauditmt
libtool: link: x86_64-pc-linux-gnu-gcc -D_REENTRANT -D_GNU_SOURCE -O2 -pipe -Wl,-O1 -o autrace autrace.o delete_all.o auditctl-llist.o  -Wl,--as-needed -lpthread -L/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/src/mt -lauditmt
make[2]: Leaving directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/src'
Making all in audisp
make[2]: Entering directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp'
Making all in plugins
make[3]: Entering directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp/plugins'
Making all in builtins
make[4]: Entering directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp/plugins/builtins'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp/plugins/builtins'
Making all in remote
make[4]: Entering directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp/plugins/remote'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../.. -I.. -I../../../lib    -fPIE -DPIE -g -D_REENTRANT -D_GNU_SOURCE -Wundef -O2 -pipe -c -o audisp_remote-audisp-remote.o `test -f 'audisp-remote.c' || echo './'`audisp-remote.c
In file included from audisp-remote.c:34:0:
remote-config.h:27:52: error: redefinition of typedef 'mode_t' with different type
/usr/include/sys/types.h:71:18: note: previous declaration of 'mode_t' was here
make[4]: *** [audisp_remote-audisp-remote.o] Error 1
make[4]: Leaving directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp/plugins/remote'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp/plugins'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4/audisp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-process/audit-1.7.4/work/audit-1.7.4'
make: *** [all] Error 2
emake failed


Reproducible: Always

Steps to Reproduce:
1. toolchain: gcc-4.6.0, glibc-2.13-r2, binutils-2.20.1-r1
2. emerge audit



It will probably fail on all arches and all profiles.
Comment 1 Anthony Basile gentoo-dev 2011-04-05 11:07:55 UTC
Okay I think this is a name conflict.  In audisp/plugins/remote/remote-config.h on line 27 we have mode_t defined as an enum:

typedef enum { M_IMMEDIATE, M_STORE_AND_FORWARD  } mode_t;

However, 

1) <sys/types.h> has mode_t typedefed to __mode_t which in 

2) <bits/types.h> is typedefed to __MODE_T_TYPE which in 

3) <bits/typesizes.h> is typedefed to __U32_TYPE which in

4) <bits/types.h> is typedefed to an unsigned int

I'm not sure why this is coming up in =gcc-4.6.0 but not <gcc-4.6.0
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2011-04-06 10:58:20 UTC
https://fedorahosted.org/audit/changeset/455
Comment 3 Jory A. Pratt gentoo-dev 2011-04-07 00:16:33 UTC
(In reply to comment #2)
> https://fedorahosted.org/audit/changeset/455

There is more then that simple two liner patch needed. I will dig into this tonight and see what we can put together.
Comment 4 Jory A. Pratt gentoo-dev 2011-04-07 00:28:45 UTC
Created attachment 268781 [details, diff]
update mode_t to rmode_t for gcc-4.6

This is tested, we can actually use a simple sed for the two instance replace as well.
Comment 5 Anthony Basile gentoo-dev 2011-04-07 01:23:04 UTC
(In reply to comment #4)
> Created attachment 268781 [details, diff]
> update mode_t to rmode_t for gcc-4.6
> 
> This is tested, we can actually use a simple sed for the two instance replace
> as well.

It *is* just two lines, the name conflict.  I tried it as soon as Ryan posted, and it compiled, but I remain confused.  Why does gcc-4.6.0 bring out the problem but gcc-4.5.2 misses it?  This worries me about unpredictable effects due to the new behavior.  *shrug*
Comment 6 Jory A. Pratt gentoo-dev 2011-04-10 13:45:20 UTC
Created attachment 269291 [details, diff]
change mode_t to rmode_t via sed

This is the cleanier solution to prevent unneeded cruft in the tree :) Hope we can get this landed soon.
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2011-04-16 08:02:48 UTC
Added to the overlay in the meantime.

https://overlays.gentoo.org/proj/gcc-porting/changeset/168
Comment 8 taaroa 2011-04-25 01:18:01 UTC
Created attachment 271057 [details]
Log file

another problem.
_____________________________________
Portage 2.2.0_alpha30 (hardened/linux/amd64/no-multilib, gcc-4.6.0, libc-0-r0, 2.6.38-hardened x86_64)
Comment 9 Jory A. Pratt gentoo-dev 2011-04-25 01:53:03 UTC
(In reply to comment #8)
> Created attachment 271057 [details]
> Log file
> 
> another problem.
> _____________________________________
> Portage 2.2.0_alpha30 (hardened/linux/amd64/no-multilib, gcc-4.6.0, libc-0-r0,
> 2.6.38-hardened x86_64)

Do not highjack a bug report, open a new report for the problem. Make sure you also attach emerge --info audit
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-11 03:00:28 UTC
please test 2.1.3 instead.
Comment 11 Ryan Hill (RETIRED) gentoo-dev 2011-09-22 04:58:15 UTC
2.1.3 works.