Bug 6832 - Build system: Necessary patches to get S4 to build on OpenSolaris
Summary: Build system: Necessary patches to get S4 to build on OpenSolaris
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Build (show other bugs)
Version: unspecified
Hardware: Other Solaris
: P3 normal (vote)
Target Milestone: ---
Assignee: Jelmer Vernooij
QA Contact: samba4-qa@samba.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-20 12:06 UTC by Torgeir Lerkerød
Modified: 2009-11-24 19:36 UTC (History)
5 users (show)

See Also:


Attachments
Patch 001 (1.72 KB, patch)
2009-10-20 12:06 UTC, Torgeir Lerkerød
no flags Details
Patch 0002 (2.11 KB, patch)
2009-10-20 12:07 UTC, Torgeir Lerkerød
no flags Details
Patch 0003 (1.09 KB, patch)
2009-10-20 12:07 UTC, Torgeir Lerkerød
no flags Details
Patch 0004 (32.97 KB, patch)
2009-10-20 12:08 UTC, Torgeir Lerkerød
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torgeir Lerkerød 2009-10-20 12:06:00 UTC
This patch set fixes so Samba 4 actually compiles and test solid on OpenSolaris. 

1. configure.developer don't actually finish. This is due to illegal compiler flags. Se notes in 0001 for details.

2. Build of idl files assumes that the compiler is gcc. Wrong in my case. Use perl's internal grep function to check for compiler. Se notes in 0002 for details

3. This behavior is seen by all Solaris boxes on buildfarm. This is due to how libintl is handled in samba and heimdal. One change to heimdal_build fixes this. See 0003 for details

4. <sys/mman.h> home of mmap and friends defines MAP_RENAME and friends. LDB module namespace isn't clean in this regards and make for compilation imposible. Add a prefix of LDB_ to clean up namespace. This fixes last remaining issue for compilation of Samba 4 on OpenSolaris. See 0004 for details.
Comment 1 Torgeir Lerkerød 2009-10-20 12:06:43 UTC
Created attachment 4868 [details]
Patch 001
Comment 2 Torgeir Lerkerød 2009-10-20 12:07:24 UTC
Created attachment 4869 [details]
Patch 0002
Comment 3 Torgeir Lerkerød 2009-10-20 12:07:46 UTC
Created attachment 4870 [details]
Patch 0003
Comment 4 Torgeir Lerkerød 2009-10-20 12:08:04 UTC
Created attachment 4871 [details]
Patch 0004
Comment 5 Björn Jacke 2009-10-20 16:53:20 UTC
patch 001 should better be made indepent of operating system as the sun studio compiler is also availabel on other platforms and the other way round: there can be other compilers on solaris, too. I'm not sure if there is some compiler detection code, if not - we should probably add some.
Comment 6 Andrew Bartlett 2009-10-20 22:14:10 UTC
Patch 3 and 4 look good (part of 4 is already merged).  Patches 1 and 2 need more work - using 'gcc is in the compiler name' isn't really good enough, we need something better than that.  Similarly, I would like the per-platform stuff in 1 to go via the samba-technical list for review. 
Comment 7 Torgeir Lerkerød 2009-10-21 00:36:20 UTC
(In reply to comment #5)
> patch 001 should better be made indepent of operating system as the sun studio
> compiler is also availabel on other platforms and the other way round: there
> can be other compilers on solaris, too. I'm not sure if there is some compiler
> detection code, if not - we should probably add some.

I can't see how to do this better, without writing a lot of m4 to determan make of compiler. (Outside my foo level) As is without 0001 Samba4 will not finish configure. Existing code assumes all non gnu compilers to be irix. Is that better?
Comment 8 Torgeir Lerkerød 2009-10-21 00:45:38 UTC
(In reply to comment #6)
> Patch 3 and 4 look good (part of 4 is already merged).  Patches 1 and 2 need
> more work - using 'gcc is in the compiler name' isn't really good enough, we
> need something better than that.  Similarly, I would like the per-platform
> stuff in 1 to go via the samba-technical list for review. 

A better patch for 1 and 2 is outside my abaility. I would love to come up with a better solution, but available info inside perl at 0002 level is not available. So patch just make it not use gcc flags if the compiler is not gcc. Can you se a better solution?

For patch 1 would a patch that just runes AX_CFLAGS_IRIX on irix be aceptable? As is it brakes compilation as it sets fals flags.
Comment 9 Stefan Metzmacher 2009-10-21 05:38:12 UTC
For 0001: From source4/build/m4/ax_cflags_gcc_option.m4:

dnl see also:
dnl       AX_CFLAGS_SUN_OPTION               AX_CFLAGS_HPUX_OPTION
dnl       AX_CFLAGS_AIX_OPTION               AX_CFLAGS_IRIX_OPTION

We may need to use AX_CFLAGS_SUN_OPTION(-v, DEVELOPER_CFLAGS)

0002 is broken for me with CC="cache gcc"
Comment 10 Stefan Metzmacher 2009-10-21 08:48:59 UTC
Patches 0003 and 0004 are push to master as 95ce7dff20d5629eff16cc6f7527c542987d8eb0
Comment 11 Matthias Dieter Wallnöfer 2009-11-12 04:38:53 UTC
And what is with the other patches?
Comment 12 Brian Lu (mail address dead) 2009-11-19 01:09:20 UTC
I posted a patch at https://bugzilla.samba.org/show_bug.cgi?id=6905 similar to Patch 001. Can anyone take a look at it? Thanks
Comment 13 Andrew Bartlett 2009-11-24 19:36:33 UTC
The patches we are willing to take from this bug have been applied.   For patch 2, Doing a regex on a compiler name isn't an acceptable way to determine GCC.