[Samba] Trouble cross compiling samba 4.15.5 with glibc 2.11. Problem with samba-bgqd.c

Berto Furth bertofurth at sent.com
Sun Mar 13 23:29:03 UTC 2022


Hi Samba folks,

I am having a problem cross compiling samba 4.15.5 with glibc version 2.11 . I acknowledge that this is a very old version of glibc however my target platform uses this version. There was no problem cross compiling samba 4.14.12.

The issue seems to be with newly introduced source file "source3/printing/samba-bgqd.c"

../../source3/printing/samba-bgqd.c: In function ‘main’:
../../source3/printing/samba-bgqd.c:340:28: error: ‘SIGPIPE’ undeclared (first use in this function); did you mean ‘SNDPIPE’?
  340 |         BlockSignals(true, SIGPIPE);
      |                            ^~~~~~~
      |                            SNDPIPE
../../source3/printing/samba-bgqd.c:340:28: note: each undeclared identifier is reported only once for each function it appears in
In file included from ../../source3/locking/share_mode_lock.h:20,
                 from ../../source3/printing/samba-bgqd.c:21:
../../source3/printing/samba-bgqd.c:384:28: error: ‘SIGTERM’ undeclared (first use in this function)
  384 |                 ev, frame, SIGTERM, 0, bgqd_sig_term_handler, &done);
      |                            ^~~~~~~
../../lib/tevent/tevent.h:412:41: note: in definition of macro ‘tevent_add_signal’
  412 |         _tevent_add_signal(ev, mem_ctx, signum, sa_flags, handler, private_data, \
      |                                         ^~~~~~

The problem can be fixed by adding the following include directive to samba-bgqd.c

    #include <signal.h>

The issue arises from /usr/include/sys/param.h in glibc 2.11 not containing an "#include <signal.h> " statement like modern glibc versions do. 

Do you think that if I raised a samba bug that there'd be any hope of getting this include statement added to samba-bgqd.c ? Can anyone suggest something else that might be more elegant to resolve this issue with compiling samba using glibc 2.11?

Thanks very much!

Berto.



More information about the samba mailing list