Bug 11984 - failed to compile on Mac OS X.
Summary: failed to compile on Mac OS X.
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.4.4
Hardware: All Mac OS X
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
: 13574 (view as bug list)
Depends on: 11811
  Show dependency treegraph
Reported: 2016-06-21 04:44 UTC by hirochachacha
Modified: 2019-06-12 07:35 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description hirochachacha 2016-06-21 04:44:23 UTC
I found two issues about building samba on darwin.

First error is:

[1307/3646] Compiling lib/dbwrap/dbwrap.c
In file included from ../lib/dbwrap/dbwrap.c:26:
In file included from ../lib/dbwrap/dbwrap.h:27:
In file included from ../lib/param/loadparm.h:259:
default/lib/param/param_local.h:141:1: error: field has incomplete type 'struct timespec'
../lib/param/loadparm.h:253:18: note: expanded from macro 'LOADPARM_EXTRA_LOCALS'
        struct timespec usershare_last_mod;                             \
default/lib/param/param_local.h:141:1: note: forward declaration of 'struct timespec'
../lib/param/loadparm.h:253:9: note: expanded from macro 'LOADPARM_EXTRA_LOCALS'
        struct timespec usershare_last_mod;                             \
1 error generated.
Waf: Leaving directory `/Users/hiro/work/samba/bin'
Build failed:  -> task failed (err #1):
	{task: cc dbwrap.c -> dbwrap_1.o}

It can be fixed by adding '#include "system/time.h"' to lib/param/loadparam.h

Second error is:

[3590/3646] Linking default/source4/torture/smbtorture
clang: warning: argument unused during compilation: '-pie'
Undefined symbols for architecture x86_64:
  "_getgrent_r", referenced from:
      _test_enum_r_group in nss_tests_1.o
  "_getpwent_r", referenced from:
      _test_enum_r_passwd in nss_tests_1.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Because of OS X doesn't have getgrent_r and getpwent_r,
I used HAVE_GETGRENT_R and HAVE_GETPWENT_R to skip tests at source4/torture/local/nss_tests.

I also confirmed above issues on latest source code.
Comment 1 hirochachacha 2016-06-24 13:16:37 UTC
First error is duplicate of https://bugzilla.samba.org/show_bug.cgi?id=11811
Comment 2 Andrew Bartlett 2019-06-11 20:46:28 UTC
*** Bug 13574 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Bartlett 2019-06-12 07:35:57 UTC
Fixed by f460bb52ed4393722d58f9e6d30bd0c7e6a51f1d in Samba 4.10 (timespec is in bug 11811)