Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007256OCamlconfigure and build/installpublic2016-05-14 02:132016-09-27 16:09
Reporterjunsli 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformSparcOSSolarisOS Version11
Product Version 
Target VersionFixed in Version4.04.0 +dev / +beta1 / +beta2 
Summary0007256: trunk build fails on Sparc Solaris 11
DescriptionFollow instructions in INSTALL, and get the following error:

gcc -m32 -std=gnu99 -O2 -fno-strict-aliasing -fwrapv -Wall -Werror -D_FILE_OFFSET_BITS=64 -D_REENTRANT -I../../byterun -fPIC -I../unix -DIN_OCAML_BIGARRAY -DCAML_NAME_SPACE -c mmap_unix.c
In file included from /usr/include/iso/string_iso.h:24:0,
                 from /usr/include/string.h:11,
                 from mmap_unix.c:21:
/usr/include/sys/feature_tests.h:354:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^
gmake[3]: *** [mmap_unix.o] Error 1
Steps To Reproduce./configure -cc "gcc -m32" -as "as -32" -aspp "gcc -m32 -c"
gmake world
Additional Information$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.8/lib/gcc/sparc-sun-solaris2.11/4.8.2/lto-wrapper
Target: sparc-sun-solaris2.11
Configured with: ...configure CC=/usr/gcc/4.7/bin/gcc CXX=/usr/gcc/4.7/bin/g++ --prefix=/usr/gcc/4.8 --mandir=/usr/gcc/4.8/share/man --bindir=/usr/gcc/4.8/bin --libdir=/usr/gcc/4.8/lib --sbindir=/usr/gcc/4.8/sbin --infodir=/usr/gcc/4.8/share/info --libexecdir=/usr/gcc/4.8/lib --enable-languages=c,c++,fortran,objc --enable-shared --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --without-gnu-ld --with-ld=/usr/bin/ld --without-gnu-as --with-as=/usr/bin/as CFLAGS='-g -O2 -mtune=ultrasparc -mcpu=ultrasparc -mno-unaligned-doubles' CXXFLAGS='-g -O2 -mtune=ultrasparc -mcpu=ultrasparc -mno-unaligned-doubles'
Thread model: posix
gcc version 4.8.2 (GCC)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0015927)
junsli (reporter)
2016-05-14 02:30

Well, it builds and bootstraps successfully if I remove #define XOPEN_SOURCE in mmap_unix.c, so it seems all we need is just another guard for that #define.
(0015928)
gasche (administrator)
2016-05-14 03:37

My understanding from

  https://lists.gnu.org/archive/html/bug-wget/2015-12/msg00140.html [^]
  https://sourceforge.net/p/libpng/bugs/245/#a56e [^]

is that Solaris is a bit too clever and refuses to combine the "modern" setting -std=c99 with the "old" requirement (#define _XOPEN_SOURCE 500), which corresponds to a pre-2000 POSIX standard. It either accepts _XOPEN_SOURCE 500 with an older C version (eg. -std=c89), or a modern language requirement with a more recent standard requirement, eg. _XOPEN_SOURCE 600.

Could you confirm that the build also works if you replace the _XOPEN_SOURCE definition by 600 instead of 500?

(I think in that case it might be a better fix than just disabling the define, as some other functions may test for this _XOPEN_SOURCE define for availability.)
(0015932)
junsli (reporter)
2016-05-14 23:04

Thanks. Defining it to 600 compiles (bytecode compiler). 4.02 compiles too.

(I see flag _XOPEN_SOURCE is added in 4.00.0).

By the way, It seems that running unit test requires native compiler, and configure reports no native compiler on Sparc Solaris, so I can't run test. It's unclear if all functions are working correctly.

I'll build on Linux and Mac to see if this change affects anything.
(0015933)
junsli (reporter)
2016-05-16 06:31

OK. No regression found on Linux and Mac OS.
(0015934)
gasche (administrator)
2016-05-16 13:14

Could you send the update to 600 as a pull request maybe? I don't know much about why this requirement was put here and what upgrading it impacts, but the PR would be a place to gather feedback from people that know better.
(0015936)
junsli (reporter)
2016-05-17 04:16
edited on: 2016-05-17 12:45

Yes, that's what I was thinking. See GPR#588.

https://github.com/ocaml/ocaml/pull/588 [^]

(0016331)
doligez (administrator)
2016-09-27 16:09

GPR#588 was merged (commit 8e2cf44).

- Issue History
Date Modified Username Field Change
2016-05-14 02:13 junsli New Issue
2016-05-14 02:30 junsli Note Added: 0015927
2016-05-14 03:37 gasche Note Added: 0015928
2016-05-14 03:37 gasche Status new => acknowledged
2016-05-14 23:04 junsli Note Added: 0015932
2016-05-16 06:31 junsli Note Added: 0015933
2016-05-16 13:14 gasche Note Added: 0015934
2016-05-17 04:16 junsli Note Added: 0015936
2016-05-17 12:45 gasche Note Edited: 0015936 View Revisions
2016-09-27 16:09 doligez Note Added: 0016331
2016-09-27 16:09 doligez Status acknowledged => closed
2016-09-27 16:09 doligez Resolution open => fixed
2016-09-27 16:09 doligez Fixed in Version => 4.04.0 +dev / +beta1 / +beta2
2017-02-23 16:38 doligez Category OCaml internal build/install (Makefiles, configure) => configure and build/install


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker