| Summary: | dev-lang/ocaml-4.02.3[ocamlopt] fails to build on musl | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Justin Keogh <bugs.gentoo.org> |
| Component: | [OLD] Development | Assignee: | Gentoo Team for the ML programming language family <ml> |
| Status: | RESOLVED OBSOLETE | ||
| Severity: | normal | CC: | felix.janda, gienah |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | AMD64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
/var/tmp/portage/dev-lang/ocaml-4.02.3/temp/build.log
emerge --info '=dev-lang/ocaml-4.02.3::gentoo' emerge -pqv '=dev-lang/ocaml-4.02.3::gentoo' /var/tmp/portage/dev-lang/ocaml-4.02.3/temp/environment build.log with "emake world -n" Proposed patch against ocaml-4.02.3 build.log with "emake world -n" and patch 417262 |
||
|
Description
Justin Keogh
2015-11-17 04:34:34 UTC
Created attachment 417176 [details]
emerge --info '=dev-lang/ocaml-4.02.3::gentoo'
Created attachment 417178 [details]
emerge -pqv '=dev-lang/ocaml-4.02.3::gentoo'
Created attachment 417180 [details]
/var/tmp/portage/dev-lang/ocaml-4.02.3/temp/environment
USE="$USE -ocamlopt" emerge dev-lang/ocaml compiles OK USE="$USE ocamlopt" emerge dev-lang/ocaml fails This blocks net-misc/unison because:
The following USE changes are necessary to proceed:
(see "package.use" in the portage(5) man page for more details)
# required by net-misc/unison-2.48.3::gentoo
# required by unison (argument)
>=dev-lang/ocaml-4.02.3 ocamlopt
Changing "emake world" to "emake world -n" in src_compile() of /usr/portage/dev-lang/ocaml/ocaml-4.02.3.ebuild results in a different failure: ../byterun/caml/instruct.h > opnames.ml ../boot/ocamlrun ../boot/ocamlc -nostdlib -I ../boot -c -strict-sequence -w +27+32..39 -warn-error A -safe-string -I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp -I ../driver -I ../toplevel opnames.ml ../boot/ocamlrun ../boot/ocamlc -nostdlib -I ../boot -c -strict-sequence -w +27+32..39 -warn-error A -safe-string -I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp -I ../driver -I ../toplevel ../utils/tbl.mli make[4]: *** No rule to make target '../bytecomp/opcodes.cmo', needed by 'dumpobj.cmo'. Stop. make[4]: Leaving directory '/var/tmp/portage/dev-lang/ocaml-4.02.3/work/ocaml-4.02.3/tools' Makefile:720: recipe for target 'ocamltools' failed make[3]: *** [ocamltools] Error 2 make[3]: Leaving directory '/var/tmp/portage/dev-lang/ocaml-4.02.3/work/ocaml-4.02.3' Makefile:206: recipe for target 'coreall' failed make[2]: *** [coreall] Error 2 make[2]: Leaving directory '/var/tmp/portage/dev-lang/ocaml-4.02.3/work/ocaml-4.02.3' Makefile:129: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/var/tmp/portage/dev-lang/ocaml-4.02.3/work/ocaml-4.02.3' Makefile:137: recipe for target 'world' failed make: *** [world] Error 2 * ERROR: dev-lang/ocaml-4.02.3::gentoo failed (compile phase): * emake failed full build log attached as ocaml-4.02.3_build.log_with_emake_world_-n Created attachment 417254 [details]
build.log with "emake world -n"
This appears to be musl specific, I can not reproduce it on a very similar (same config files, different CHOST) glibc system. How does the "Configuration summary" look on the glibc system? Are shared libraries also not supported? I've just tried compiling on musl (outside of emerge). The configure output contains dlopen() found. Dynamic loading of shared libraries is supported. mmap() found. I think it would be good to investigate why you don't have the second line. Created attachment 417262 [details, diff]
Proposed patch against ocaml-4.02.3
The configure script has some intricate knowledge about which targets
support shared libraries but has not heard that non-gnu linux might
support them as well...
Please try compiling with this patch.
Same error with patch applied (I manually verified that /var/tmp/portage/dev-lang/ocaml-4.02.3/work/ocaml-4.02.3/configure was properly patched in src_prepare()). The good news is ./configure now shows the 'Dynamic loading of shared libraries is supported' line.
setlocale() and <locale.h> found.
dlopen() found.
Dynamic loading of shared libraries is supported.
mmap() found.
pwrite() found
stat() supports nanosecond precision.
gethostbyname_r() found (with 6 arguments).
gethostbyaddr_r() found (with 8 arguments).
mkstemp() found
nice() found
Replay debugger supported.
System stack overflow can be detected.
POSIX threads library supported.
Options for linking with POSIX threads: -lpthread
sigwait() found
Bytecode threads library supported.
[WARNING] Cannot compile X11 program.
[WARNING] X11 not found, the "graph" library will not be supported.
[WARNING] BFD library not found, 'objinfo' will be unable to display info on .cmxs files.
Assembler supports CFI
** Configuration summary **
Directories where OCaml will be installed:
binaries.................. /usr/bin
standard library.......... /usr/lib/ocaml
manual pages.............. /usr/share/man (with extension .1)
Configuration for the bytecode compiler:
C compiler used........... x86_64-gentoo-linux-musl-gcc
options for compiling..... -march=native -O2 -pipe -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
options for linking....... -Wl,-O1 -Wl,--as-needed -nopie -Wl,-E -lm -lcurses -lpthread
shared libraries are supported
options for compiling..... -O -fPIC -march=native -O2 -pipe -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
command for building...... x86_64-gentoo-linux-musl-gcc -shared -Wl,-O1 -Wl,--as-needed -nopie -o lib.so -Wl,-rpath,/a/path objs
Configuration for the native-code compiler:
hardware architecture..... amd64
OS variant................ linux
C compiler used........... x86_64-gentoo-linux-musl-gcc
options for compiling..... -march=native -O2 -pipe -O -D_FILE_OFFSET_BITS=64 -D_REENTRANT
options for linking....... -Wl,-O1 -Wl,--as-needed -nopie -lm
assembler ................ x86_64-gentoo-linux-musl-as
preprocessed assembler ... x86_64-gentoo-linux-musl-gcc -c
assembler supports CFI ... yes
with frame pointers....... no
naked pointers forbidden.. no
native dynlink ........... true
profiling with gprof ..... supported
Source-level replay debugger: supported
Additional libraries supported:
unix str num dynlink bigarray systhreads threads
Configuration for the "num" library:
target architecture ...... amd64 (asm level 1)
The "graph" library: not supported
** OCaml configuration completed successfully **
full build log attached as ocaml-4.02.3_build.log_with_emake_world_-n_and_patch_417262
Created attachment 417310 [details]
build.log with "emake world -n" and patch 417262
Is there any reasoning for changing "emake world" to "emake world -n"? I guess it just breaks everything. Yep! I thought it was just extra verbose but no: man make says "Print the commands that would be executed, but do not execute them (except in certain circumstances).". Oops. Your patch fixes it. I double checked. Without -n, the compile fails with the orig "sh: -W: invalid option". Submitted the patch upstream: https://github.com/ocaml/ocaml/pull/558 The patch is now upstream: https://github.com/ocaml/ocaml/commit/2ddcd4de9b5f4616f9790a26e6e56489366c9137 Could it be added to the in tree ebuilds? (In reply to Felix Janda from comment #16) > The patch is now upstream: > > https://github.com/ocaml/ocaml/commit/ > 2ddcd4de9b5f4616f9790a26e6e56489366c9137 > > Could it be added to the in tree ebuilds? That will be in 4.05 I think. I'd prefer not touching anything in 4.04 now that it is stable. Is this still an issue? |