Created attachment 11624 [details] Header Fille from ../lib/replace/system I try to compile Samba 4.3.1 on AIX 7.1.3. Configure was finished successfully but if I compile Samba 4.3.1 I get the following error with time.h: [ 582/3754] Compiling lib/util/time.c In file included from ../lib/replace/system/time.h:31:0, from ../lib/util/time.c:25: ../lib/util/time.c: In function 'clock_gettime_mono': ../lib/replace/system/time.h:85:32: error: missing binary operator before token "10" #define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC ^ ../lib/util/time.c:63:5: note: in expansion of macro 'CUSTOM_CLOCK_MONOTONIC' #if CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME ^ Waf: Leaving directory `/opt/samba-4.3.1/bin' Build failed: -> task failed (err #1): {task: cc time.c -> time_12.o} make: The error code from the last command is 1. Stop.
AIX Version: 7100-03-05-1524 XLC Version: 13.01.0003.0000 Samba Version: 4.3.4 This is due to AIX defining CLOCK_* as cast expressions rather than integer constants which breaks #if CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME when CUSTOM_CLOCK_MONOTONIC is defined as CLOCK_MONOTONIC or CLOCK_HIGHRES in lib/replace/system/time.h. This was introduced by cf87f8587415df2119995e82ccf51bb64e44115b and there does not seem to be other occurrences of this problem elsewhere. I'll see if I can get a legal authorization to contribute a patch from my dept.
Hi Guillaume, this would be excellent if you could help me. Good luck, many thanks in advance and best regards. Andreas
Is this the same problem as in Bug 11214?
I can't test it but it looks like it is.
Hi Christian, I'm not sure. I have a problem with a preprozessor compare in the header file ../lib/replace/system/time.h. Best regards Andreas
Hi Guillaume, would you like to tell me that there is no solution for it? Best regards Andreas
Created attachment 11863 [details] Proposed patch
Hi Andreas, Sorry it took so long, I was waiting for my approvals from corp. Here's the patch i used to fix this problem. Unfortunately it won't get you very far as there are several more bugs to fix after this one. Christian, On my AIX in <time.h>: #define CLOCK_MONOTONIC ((clockid_t) 10) This is probably what's causing Bug 11214 (missing binary operator before token "10"). Since there are no more aix machines in the build farm, can this patch, and the other ones I'll submit for aix compat. issues, still be integrated into 4-3-* (as long as they don't break other platforms) ?
*** Bug 11839 has been marked as a duplicate of this bug. ***
Hi, can somebody tell me, what I have to do, that I don't get the error any more? If I insert the line "#define CLOCK_MONOTONIC ((clockid_t) 10)" before the following block in ../lib/replace/system/time.h, I get the error at the end of this psoting. #ifndef HAVE_CLOCK_GETTIME /* CLOCK_REALTIME is required by POSIX */ #define CLOCK_REALTIME 0 typedef int clockid_t; int rep_clock_gettime(clockid_t clk_id, struct timespec *tp); #endif /* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on */ #if defined(CLOCK_MONOTONIC) #define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC #elif defined(CLOCK_HIGHRES) #define CUSTOM_CLOCK_MONOTONIC CLOCK_HIGHRES #else #define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME #endif In file included from ../lib/util/time.c:25:0: ../lib/util/time.c: In function 'clock_gettime_mono': ../lib/replace/system/time.h:77:47: error: missing binary operator before token "10" #define CLOCK_MONOTONIC ((clockid_t) 10) ^ ../lib/replace/system/time.h:88:32: note: in expansion of macro 'CLOCK_MONOTONIC' #define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC ^ ../lib/util/time.c:63:5: note: in expansion of macro 'CUSTOM_CLOCK_MONOTONIC' #if CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME ^ [ 554/3676] Compiling lib/util/sys_rw.c Waf: Leaving directory `/opt/samba-4.4.2/bin' Build failed: -> task failed (err #1): {task: cc time.c -> time_14.o} make: The error code from the last command is 1. Many thanks in advance Andreas
This also applies to Samba 4.4.3 with xlc compiler 13.1.3 This patch works correctly
I have tried to compile Samba 4.4.3 with xlc 13.1.3 and I still get the following error: Waf: Entering directory `/opt/samba-4.4.3/bin' Selected embedded Heimdal build [ 503/3338] Compiling lib/util/time.c "../lib/util/time.c", line 63.5: 1506-294 (S) Syntax error in expression on #if directive. Waf: Leaving directory `/opt/samba-4.4.3/bin' Build failed: -> task failed (err #1): {task: cc time.c -> time_14.o} make: The error code from the last command is 1. Stop. Line 63 in time.c is the following statment and clolumn 5 is the String CUSTOM_CLOCK_MONOTONIC /* then try the monotonic clock: */ #if CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME if (clock_gettime(CUSTOM_CLOCK_MONOTONIC,tp) == 0) { return; } #endif clock_gettime(CLOCK_REALTIME,tp); } Who can help me? what I have to do? P.S. Why is it so complicated that nobody give me an answer which helps. Regards and hoping of a solution Andreas
(In reply to Andreas Paulat from comment #12) > P.S. Why is it so complicated that nobody give me an answer which helps. It's not that the fix will be complicated. It's the fact that no developer I know has access to AIX. If we had, this would be fixed very quickly. Volker
Hi Volker, if it is possible please send me the changes which you like to make and I do it for you on my test AIX. Best regards, Andreas
(In reply to Andreas Paulat from comment #14) > if it is possible please send me the changes which you like to make and I do > it for you on my test AIX. I'm afraid this is not the way I can do development. I need to take a look at the system, at what is there. If you want this fixed, make a contract with someone including terms that you can allow interactive logon to such a box or get someone on your premises to let her in. Volker
Hi Volker, it would be possible that you can connect to our Test-AIX with TeamViewer. Would you do this? Regards, Andreas
Hi Volker, could you please give me an answer of my last request, so that I know if it is possible or not? Many thanks and best regards Andreas
(In reply to Andreas Paulat from comment #17) > could you please give me an answer of my last request, so that I know if it > is possible or not? Technically it would of course be possible. But TeamViewer is such a pain in the <whatever> that this is not viable. Also, you definitely want a contract with someone for this, if only for the NDA piece. I would highly recommend to contact IBM to get you up-to-date SMB support for AIX or visit https://www.samba.org/samba/support/ to get build support. Volker
(In reply to Guillaume Xavier Taillon from comment #7) I tested this patch on AIX 5.3, 6.1, and 7.1 and it works. Please push.
thanks, fixed with 67095c76f64c61a5472c0233e44520ccc4eddbc8, will be in 4.7.
*** Bug 11214 has been marked as a duplicate of this bug. ***