Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trunk build fails on Sparc Solaris 11 #7256

Closed
vicuna opened this Issue May 14, 2016 · 7 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

commented May 14, 2016

Original bug ID: 7256
Reporter: junsli
Status: closed (set by @damiendoligez on 2016-09-27T14:09:49Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: Sparc
OS: Solaris
OS Version: 11
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: configure and build/install
Monitored by: @gasche

Bug description

Follow 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)

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented May 14, 2016

Comment author: junsli

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented May 14, 2016

Comment author: @gasche

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.)

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented May 14, 2016

Comment author: junsli

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented May 16, 2016

Comment author: junsli

OK. No regression found on Linux and Mac OS.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented May 16, 2016

Comment author: @gasche

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.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented May 17, 2016

Comment author: junsli

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

#588

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 27, 2016

Comment author: @damiendoligez

#588 was merged (commit 8e2cf44).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.