Bug 6842 - Fails to build on QNX due to missing definition of uint_t
Summary: Fails to build on QNX due to missing definition of uint_t
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Build (show other bugs)
Version: unspecified
Hardware: x86 Other
: P3 normal (vote)
Target Milestone: ---
Assignee: Jelmer Vernooij
QA Contact: samba4-qa@samba.org
URL: http://build.samba.org/?function=View...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-23 12:10 UTC by Matt Kraai (mail address dead)
Modified: 2010-02-02 01:53 UTC (History)
1 user (show)

See Also:


Attachments
Change uint_t to unsigned int (106.86 KB, patch)
2009-12-17 23:19 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int (106.93 KB, patch)
2009-12-17 23:25 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in lib/crypto (1.25 KB, patch)
2010-01-05 10:59 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in lib/talloc (3.19 KB, patch)
2010-01-05 10:59 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in lib/util (2.89 KB, patch)
2010-01-05 10:59 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in libcli (3.08 KB, patch)
2010-01-05 11:00 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in pidl (572 bytes, patch)
2010-01-05 11:00 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in source3 (5.11 KB, patch)
2010-01-05 11:00 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in source4 (90.74 KB, patch)
2010-01-05 11:01 UTC, Matt Kraai (mail address dead)
no flags Details
Change uint_t to unsigned int in lib/replace (1.65 KB, patch)
2010-01-05 11:01 UTC, Matt Kraai (mail address dead)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Kraai (mail address dead) 2009-10-23 12:10:03 UTC
3050f832 broke the build of Samba 4 on QNX because it cannot find the definition of uint_t when compiling param/provision.c:

Compiling param/provision.c
In file included from /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:26,
                 from param/provision.c:28:
/home/build/build_farm/samba_4_0_test/source/libcli/raw/request.h:61: error: expected specifier-qualifier-list before 'uint_t'
In file included from param/provision.c:28:
/home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:66: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:95: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:124: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:195: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:258: error: expected specifier-qualifier-list before 'uint_t'
In file included from /home/build/build_farm/samba_4_0_test/source/libcli/raw/libcliraw.h:310,
                 from param/provision.c:28:
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:188: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:491: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:581: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:588: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:735: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:996: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:1477: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:2487: error: expected specifier-qualifier-list before 'uint_t'
/home/build/build_farm/samba_4_0_test/source/libcli/raw/interfaces.h:2571: error: expected specifier-qualifier-list before 'uint_t'
The following command failed:
ccache gcc -I/usr/local/stow/python-2.6.2/include/python2.6 -I/usr/local/stow/python-2.6.2/include/python2.6 -Ilib/ldb/include -Ilib/ldb/include -I./lib/ldb/include -I/home/build/build_farm/samba_4_0_test/source/lib/ldb/include -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/include   -Iheimdal/../heimdal_build -Iheimdal/lib/hdb -I./heimdal_build -I/home/build/build_farm/samba_4_0_test/source/heimdal_build -I./heimdal/lib/roken -I/home/build/build_farm/samba_4_0_test/source/heimdal/lib/roken -Iheimdal/lib/hdb -Ilib/ldb/include -Ilib/ldb/include -Ilib/ldb/ldb_tdb -Ilib/ldb/include -Ilib/ldb/include     -Iheimdal/../heimdal_build -Iheimdal/lib/gssapi -Iheimdal/lib/gssapi/gssapi -Iheimdal/lib/gssapi/spnego -Iheimdal/lib/gssapi/krb5 -Iheimdal/lib/gssapi/mech -Iheimdal/lib/gssapi -Iheimdal/lib/gssapi     -I../lib/tdb/include  -I/home/build/build_farm/samba_4_0_test/source/../lib/talloc -I../lib/zlib -Iheimdal/../heimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/asn1 -Iheimdal/lib/com_err   -Iheimdal/../heimdal_build -Iheimdal/lib/hx509 -Iheimdal/lib/hx509 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/hx509 -Iheimdal/../heimdal_build -Iheimdal/lib/hcrypto -Iheimdal/lib -Iheimdal/../heimdal_build -Iheimdal/lib/hcrypto/imath -Iheimdal/../heimdal_build -Iheimdal/lib/wind -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/lib/asn1 -Iheimdal/../heimdal_build -Iheimdal/lib/asn1 -Iheimdal/../heimdal_build -Iheimdal/lib/com_err -Iheimdal/../heimdal_build -Iheimdal/lib/roken -Iheimdal/include -I../lib/socket_wrapper   -I./lib/events -I/home/build/build_farm/samba_4_0_test/source/lib/events   -I/usr/local/include  -I../lib/tevent   -I../lib/talloc -Ilib/replace      -I/usr/local/stow/python-2.6.2/include/python2.6 -I/usr/local/stow/python-2.6.2/include/python2.6  -I/home/build/build_farm/samba_4_0_test/source/include -I/home/build/build_farm/samba_4_0_test/source -I/home/build/build_farm/samba_4_0_test/source/lib -I/home/build/build_farm/samba_4_0_test/source/../lib/replace -I/home/build/build_farm/samba_4_0_test/source/../lib/talloc -I/home/build/build_farm/samba_4_0_test/source/.. -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H  -c param/provision.c -o param/provision.o
make: *** [param/provision.o] Error 1

3050f832 changed param/provision.c to include Python.h before any other headers.  The Python headers define _POSIX_C_SOURCE to 200112L.  When they include sys/types.h, this definition prevents sys/types.h from defining uint_t.

Before this commit, the Samba headers would include sys/types.h without defining _POSIX_C_SOURCE, which would cause the header to define uint_t.
Comment 1 Matthias Dieter Wallnöfer 2009-10-23 17:26:03 UTC
It seems to be hard to do it properly. On most platforms the mentioned commit 3050f832 didn't change anything.
To be honest I think that it's more a bug of the python or system header of QNX than our problem. Since including a "Python.h" at the top shouldn't prevent the use of "uint_t" at all.

As workaround I suggest to add a "#define uint_t unsigned" at the bottom of the system "Python.h" file for now. Then I would inform the python project about this interesting bug.
Comment 2 Matt Kraai (mail address dead) 2009-10-26 12:01:12 UTC
(In reply to comment #1)
> As workaround I suggest to add a "#define uint_t unsigned" at the bottom of the
> system "Python.h" file for now. Then I would inform the python project about
> this interesting bug.

Done.  See http://bugs.python.org/issue7209.
Comment 3 Matthias Dieter Wallnöfer 2009-11-12 04:49:02 UTC
Matt, please inform us when the python project handles your bug request. If they don't we have to find a viable solution in our code base.
Comment 4 Matt Kraai (mail address dead) 2009-11-12 09:07:34 UTC
(In reply to comment #3)
> Matt, please inform us when the python project handles your bug request. If
> they don't we have to find a viable solution in our code base.

Will do.  Unfortunately, in my experience they don't seem to be very responsive (c.f., http://bugs.python.org/issue4532).  :(
Comment 5 Matthias Dieter Wallnöfer 2009-12-15 10:07:32 UTC
Well, I think we need to find a solution here (since as you said the python project doesn't care about QNX). I would like to hear Jelmer's or metze's opinion about such a corrective "uint_t" define. I thought maybe to put it into "libreplace" (but where exactly does it fit? In a header?).
Comment 6 Jelmer Vernooij 2009-12-17 11:18:52 UTC
Can't we just avoid using uint_t altogether but use "unsigned int" ? That should work everywhere.
Comment 7 Matthias Dieter Wallnöfer 2009-12-17 11:36:11 UTC
(In reply to comment #6)
> Can't we just avoid using uint_t altogether but use "unsigned int" ? That
> should work everywhere.
> 

Sure, Jelmer. But we have approximately 360 lines where this is used (counted with "cscope"). And also if we would change all those lines we aren't sure that someone reintroduces "uint_t"s. Therefore I suggest a substitution macro.
Comment 8 Matt Kraai (mail address dead) 2009-12-17 22:58:12 UTC
(In reply to comment #7)
> Sure, Jelmer. But we have approximately 360 lines where this is used (counted
> with "cscope"). And also if we would change all those lines we aren't sure that
> someone reintroduces "uint_t"s. Therefore I suggest a substitution macro.

libreplace already checks whether the system provides a definition of uint_t and, if it doesn't, defines it to be an unsigned int.  On QNX, which does normally define uint_t, this does nothing.

In this bug, the problem is that the Python headers, which are included first, prevent the system headers from defining uint_t.  Since libreplace thinks it doesn't need to provide a definition, no definition is provided anywhere and the build breaks.
Comment 9 Matt Kraai (mail address dead) 2009-12-17 23:19:44 UTC
Created attachment 5099 [details]
Change uint_t to unsigned int

The following patch removes checks for and definitions of uint_t and changes uses of uint_t to unsigned int.
Comment 10 Matt Kraai (mail address dead) 2009-12-17 23:25:14 UTC
Created attachment 5100 [details]
Change uint_t to unsigned int

The previous patch was generated against an old revision and had conflicts when applied to the latest revision.  This patch applies cleanly against 7cb858e.
Comment 11 Stefan Metzmacher 2010-01-05 01:42:15 UTC
Can you please split this patch into smaller parts:

 lib/crypto/
 lib/talloc/
 lib/util/
 libcli/
 pidl/
 source3/
 source4/
 lib/replace/
Comment 12 Matt Kraai (mail address dead) 2010-01-05 10:58:28 UTC
(In reply to comment #11)
> Can you please split this patch into smaller parts:
> 
>  lib/crypto/
>  lib/talloc/
>  lib/util/
>  libcli/
>  pidl/
>  source3/
>  source4/
>  lib/replace/

Sure.
Comment 13 Matt Kraai (mail address dead) 2010-01-05 10:59:08 UTC
Created attachment 5121 [details]
Change uint_t to unsigned int in lib/crypto
Comment 14 Matt Kraai (mail address dead) 2010-01-05 10:59:25 UTC
Created attachment 5122 [details]
Change uint_t to unsigned int in lib/talloc
Comment 15 Matt Kraai (mail address dead) 2010-01-05 10:59:42 UTC
Created attachment 5123 [details]
Change uint_t to unsigned int in lib/util
Comment 16 Matt Kraai (mail address dead) 2010-01-05 11:00:29 UTC
Created attachment 5124 [details]
Change uint_t to unsigned int in libcli
Comment 17 Matt Kraai (mail address dead) 2010-01-05 11:00:42 UTC
Created attachment 5125 [details]
Change uint_t to unsigned int in pidl
Comment 18 Matt Kraai (mail address dead) 2010-01-05 11:00:57 UTC
Created attachment 5126 [details]
Change uint_t to unsigned int in source3
Comment 19 Matt Kraai (mail address dead) 2010-01-05 11:01:09 UTC
Created attachment 5127 [details]
Change uint_t to unsigned int in source4
Comment 20 Matt Kraai (mail address dead) 2010-01-05 11:01:21 UTC
Created attachment 5128 [details]
Change uint_t to unsigned int in lib/replace
Comment 21 Matthias Dieter Wallnöfer 2010-01-29 14:04:30 UTC
Jelmer, Metze here we really need to find a solution!
Comment 22 Matthias Dieter Wallnöfer 2010-02-02 01:53:57 UTC
Thanks Matt to provide the patches and metze for merging them! I close this as "FIXED".