There are two problems that prevent Samba from compiling on QNX. First, tr does not interpret "\n" correctly, which causes mkproto.h to hang because proto_src is empty, so awk hangs trying to read from standard input. This can be resolved by using "\012" instead. Second, it does not provide the uint type, which is used in various places. I'll provide a patch shortly which fixes both of these issues.
Created attachment 2920 [details] Patch
Created attachment 4366 [details] Patch To build Samba 3.3.6 on QNX 6.4.1, the only changes required are to replace occurrences of uint with unsigned, as done by this patch.
Created attachment 4385 [details] Patch The attached patch has been generated against the latest version of Samba in the Git repository.
Created attachment 4386 [details] Patch to not redefine _INT32 When Samba is compiled, the compiler complains for almost every source file that _INT32 is redefined. This patch makes includes.h define it only if it hasn't already been defined. The comment for this macro definition indicates that the definition is necessary to work around a compile issue on HP-UX 11.x, but it doesn't indicate whether a patch of this type would be acceptable and I don't have access to such a system.
Created attachment 4387 [details] Patch to define _LARGEFILE64_SOURCE on QNX If _LARGEFILE64_SOURCE is not defined, the system headers don't declare fopen64 or readdir64. When lib/system.c is compiled, it expects their return values to be pointers. Since there aren't any prototypes, their return values default to int and the compiler warns about the mismatch. This patch defines _LARGEFILE64_SOURCE on QNX to avoid this problem.
patches from comment #4 and comment #5 are in master now, thanks. still open is the uint/unsigned thing - maybe we need to find a better way to fix that.
(In reply to comment #6) > patches from comment #4 and comment #5 are in master now, thanks. Thanks. > still open is the uint/unsigned thing - maybe we need to find a better way to > fix that. The other way I've thought of fixing this is to define (either via the preprocessor or using a typedef) uint if it's not provided by the OS, but this seems more complex and fragile. If this it what you'd prefer, I can try to prepare a patch.
the uint compile problem is fixed, too (a28596964b4) Matt asked if this could go into 3.4. I think merging the following patches are uncritical and apropriate to make 3.4 compile well on QNX, too: 0b06aa23049f s3:configure: define _LARGEFILE64_SOURCE on QNX dcf03b9d431b do not redefine _INT32 a28596964b44 s3: QNX doesn't know uint - replace with uint_t Karolin, I hand this over to you.
(In reply to comment #8) > 0b06aa23049f s3:configure: define _LARGEFILE64_SOURCE on QNX > > dcf03b9d431b do not redefine _INT32 > > a28596964b44 s3: QNX doesn't know uint - replace with uint_t Just to be clear, a28596964b44 is the only patch that's required to allow Samba to build on QNX. The other two patches, while nice to have, just eliminate warnings.
Michael, could you review the patch(es), please? I would prefer to pick a28596964b44 only, what do you think? Thanks!
Created attachment 4596 [details] Prepend "$libreplacedir/" to all objects in LIBREPLACEOBJ Samba 4 currently fails to build on QNX 6.4.1 because it can't build strptime.ho (cf. http://build.samba.org/?function=View+Build;host=qnx18;tree=samba_4_0_test;compiler=gcc). This patch fixes that problem by prepending "$libreplacedir/" to strptime.o in LIBREPLACEOBJ, as is done for the objects that do build successfully. It also makes similar changes for the rest of the libreplace object files so that they'll build on platforms that need them.
(In reply to comment #11) > Created an attachment (id=4596) [details] > Prepend "$libreplacedir/" to all objects in LIBREPLACEOBJ > > Samba 4 currently fails to build on QNX 6.4.1 because it can't build > strptime.ho (cf. > http://build.samba.org/?function=View+Build;host=qnx18;tree=samba_4_0_test;compiler=gcc). > This patch fixes that problem by prepending "$libreplacedir/" to strptime.o in > LIBREPLACEOBJ, as is done for the objects that do build successfully. It also > makes similar changes for the rest of the libreplace object files so that > they'll build on platforms that need them. To reproduce this problem on a system that has a working strptime, modify main in lib/replace/test/strptime.c so that it always returns 1.
Created attachment 4599 [details] Do not redefine strupr The latest Samba 3 on the master branch fails to build on QNX 6.4.1 because the definition of strupr in source3/libaddns/dnsgss.c conflicts with a declaration in /usr/include/string.h. This patch fixes this by checking whether strupr is provided and, if it is, not redefining it.
Comment on attachment 4596 [details] Prepend "$libreplacedir/" to all objects in LIBREPLACEOBJ Metze, could you please review this patch and the comment #11 ? I think this could resolve many issues on the buildfarm.
Is there a chance to get that into 3.4.1?
Comment on attachment 4596 [details] Prepend "$libreplacedir/" to all objects in LIBREPLACEOBJ We have this in configure.in: LIBREPLACE_OBJS="" for obj in ${LIBREPLACEOBJ}; do »·······LIBREPLACE_OBJS="${LIBREPLACE_OBJS} ${LIBREPLACE_DIR}/${obj}" done AC_SUBST(LIBREPLACE_OBJS) I don't understand why this would be needed in 3.4.x metze
Created attachment 4662 [details] Do not redefine strupr for v3-4-test This patch avoids the need of manual conflict resolving...
Comment on attachment 4386 [details] Patch to not redefine _INT32 Please cherry pick 0b06aa23049f49b985432c6b18c8a888a079eca1
Comment on attachment 4387 [details] Patch to define _LARGEFILE64_SOURCE on QNX Please cherry-pick 0b06aa23049f49b985432c6b18c8a888a079eca1
Comment on attachment 4386 [details] Patch to not redefine _INT32 Please cherry-pick dcf03b9d431bf5733bde76143da7405650ba119a sorry, I've pasted the wrong commit for this patch before...
(In reply to comment #16) > (From update of attachment 4596 [details]) > We have this in configure.in: > > LIBREPLACE_OBJS="" > for obj in ${LIBREPLACEOBJ}; do > »·······LIBREPLACE_OBJS="${LIBREPLACE_OBJS} ${LIBREPLACE_DIR}/${obj}" > done > AC_SUBST(LIBREPLACE_OBJS) > > I don't understand why this would be needed in 3.4.x I've verified that this patch isn't necessary for the 3.4 series.
The 'Prepend "$libreplacedir/" to all objects in LIBREPLACEOBJ' fix is now checked in to master. Thanks Matt! But in the future, please open new bug reports for different problems.
(In reply to comment #22) > The 'Prepend "$libreplacedir/" to all objects in LIBREPLACEOBJ' fix is now > checked in to master. Thanks Matt! But in the future, please open new bug > reports for different problems. Will do.
... reopen, and review+ for the merge of a28596964b44 to 3.4. Karolin, can you please cherry-pick this one so we can finally close this bug?
seems ok, thanks!
Pushed, closing out bug report. Thanks!