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

Crash when build on sparc64 linux #4441

Closed
vicuna opened this issue Nov 6, 2007 · 5 comments
Closed

Crash when build on sparc64 linux #4441

vicuna opened this issue Nov 6, 2007 · 5 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 6, 2007

Original bug ID: 4441
Reporter: tommat
Status: closed (set by @xavierleroy on 2007-11-12T14:22:39Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 3.10.0
Category: ~DO NOT USE (was: OCaml general)
Monitored by: tommat

Bug description

end of build:
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags filename.cmo -c filename.ml
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags complex.cmi -c complex.mli
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags complex.cmo -c complex.ml
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags arrayLabels.cmi -c arrayLabels.mli
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags arrayLabels.cmo -c arrayLabels.ml
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags listLabels.cmi -c listLabels.mli
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags listLabels.cmo -c listLabels.ml
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags stringLabels.cmi -c stringLabels.mli
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags stringLabels.cmo -c stringLabels.ml
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags moreLabels.cmi -c moreLabels.mli
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags moreLabels.cmo -c moreLabels.ml
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags stdLabels.cmi -c stdLabels.mli
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags stdLabels.cmo -c stdLabels.ml
../boot/ocamlrun ../ocamlc -a -o stdlib.cma pervasives.cmo array.cmo list.cmo char.cmo string.cmo sys.cmo hashtbl.cmo sort.cmo marshal.cmo obj.cmo int32.cmo int64.cmo nativeint.cmo lexing.cmo parsing.cmo set.cmo map.cmo stack.cmo queue.cmo stream.cmo buffer.cmo printf.cmo format.cmo scanf.cmo arg.cmo printexc.cmo gc.cmo digest.cmo random.cmo callback.cmo camlinternalOO.cmo oo.cmo camlinternalMod.cmo genlex.cmo weak.cmo lazy.cmo filename.cmo complex.cmo arrayLabels.cmo listLabels.cmo stringLabels.cmo moreLabels.cmo stdLabels.cmo
../boot/ocamlrun ../ocamlc -g -warn-error A -nostdlib ./Compflags std_exit.cmo -c std_exit.ml
make[1]: Leaving directory `/home/users/builder/rpm/BUILD/ocaml-3.10.0/stdlib'
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/genprintval.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/genprintval.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/toploop.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/toploop.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/trace.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/trace.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/topdirs.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/topdirs.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/topmain.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/topmain.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -a -o toplevel/toplevellib.cma utils/misc.cmo utils/tbl.cmo utils/config.cmo utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo utils/consistbl.cmo parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo parsing/syntaxerr.cmo parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo typing/unused_var.cmo typing/ident.cmo typing/path.cmo typing/primitive.cmo typing/types.cmo typing/btype.cmo typing/oprint.cmo typing/subst.cmo typing/predef.cmo typing/datarepr.cmo typing/env.cmo typing/typedtree.cmo typing/ctype.cmo typing/printtyp.cmo typing/includeclass.cmo typing/mtype.cmo typing/includecore.cmo typing/includemod.cmo typing/parmatch.cmo typing/typetexp.cmo typing/stypes.cmo typing/typecore.cmo typing/typedecl.cmo typing/typeclass.cmo typing/typemod.cmo bytecomp/lambda.cmo bytecomp/printlambda.cmo bytecomp/typeopt.cmo bytecomp/switch.cmo bytecomp/matching.cmo bytecomp/translobj.cmo bytecomp/translcore.cmo bytecomp/translclass.cmo bytecomp/translmod.cmo bytecomp/simplif.cmo bytecomp/runtimedef.cmo bytecomp/meta.cmo bytecomp/instruct.cmo bytecomp/bytegen.cmo bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo driver/pparse.cmo driver/errors.cmo driver/compile.cmo toplevel/genprintval.cmo toplevel/toploop.cmo toplevel/trace.cmo toplevel/topdirs.cmo toplevel/topmain.cmo
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/topstart.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c toplevel/expunge.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -o expunge utils/misc.cmo utils/tbl.cmo utils/config.cmo utils/clflags.cmo typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/meta.cmo bytecomp/symtable.cmo toplevel/expunge.cmo
boot/ocamlrun boot/ocamlc -nostdlib -I boot -linkall -o ocaml.tmp toplevel/toplevellib.cma toplevel/topstart.cmo
Fatal error: exception Out_of_memory
make: *** [ocaml] Error 2

File attachments

@vicuna
Copy link
Author

vicuna commented Nov 6, 2007

Comment author: tommat

build commands:

./configure \
-cc "sparc64-pld-linux-gcc" \
-bindir /usr/bin \
-libdir /usr/lib64/ocaml \
-mandir /usr/share/man/man1 \
-host sparc64-pld-linux-gnu \
\
-with-pthread \
-x11lib /usr/lib64

/usr/bin/make -j1 world bootstrap opt.opt CFLAGS="-O2 -fno-strict-aliasing -fwrapv -mcpu=ultrasparc -fno-strict-aliasing -gdwarf-2 -g2 -Wall"

@vicuna
Copy link
Author

vicuna commented Nov 8, 2007

Comment author: @xavierleroy

Try to add the following line to config/s.h after running configure:

#define USE_MMAP_INSTEAD_OF_MALLOC

If it works, I'll update the configure script accordingly.

Also, what does "configure" report as the system type? The first line,
"Configuring for a xxx-yyy-zzz ..."

@vicuna
Copy link
Author

vicuna commented Nov 8, 2007

Comment author: tommat

It is better now but it fails on assembler.
full build log is here:
http://pimpek.one.pl/~tommat/ocaml.log

@vicuna
Copy link
Author

vicuna commented Nov 8, 2007

Comment author: tommat

According to http://developers.sun.com/solaris/articles/sparcv9abi.html
this patch should help:
--- ocaml-3.10.0/asmrun/sparc.S.orig 2007-11-08 20:12:36.000000000 +0000
+++ ocaml-3.10.0/asmrun/sparc.S 2007-11-08 20:24:33.000000000 +0000
@@ -89,6 +89,8 @@
.global Caml_call_gc

/* Required size in %g2 */

  •   .register %g2,#scratch
    
  •   .register %g3,#scratch
    

Caml_allocN:
#ifdef INDIRECT_LIMIT
ld [Alloc_limit], %g1

And it helped but there is linking problem now (full buildlog in attachment):
cd asmrun; /usr/bin/make meta.o dynlink.o
make[1]: Entering directory /home/users/builder/rpm/BUILD/ocaml-3.10.0/asmrun' ln -s ../byterun/meta.c meta.c sparc64-pld-linux-gcc -O2 -fno-strict-aliasing -fwrapv -mcpu=ultrasparc -fno-strict-aliasing -gdwarf-2 -g2 -Wall -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_sparc -DSYS_linux -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o meta.o meta.c ln -s ../byterun/dynlink.c dynlink.c sparc64-pld-linux-gcc -O2 -fno-strict-aliasing -fwrapv -mcpu=ultrasparc -fno-strict-aliasing -gdwarf-2 -g2 -Wall -I../byterun -DCAML_NAME_SPACE -DNATIVE_CODE -DTARGET_sparc -DSYS_linux -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c -o dynlink.o dynlink.c make[1]: Leaving directory /home/users/builder/rpm/BUILD/ocaml-3.10.0/asmrun'
boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -ccopt "-Wl,-E" -o ocamlc.opt
utils/misc.cmx utils/tbl.cmx utils/config.cmx utils/clflags.cmx utils/terminfo.cmx utils/ccomp.cmx utils/warnings.cmx utils/consistbl.cmx parsing/linenum.cmx parsing/location.cmx parsing/longident.cmx parsing/syntaxerr.cmx parsing/parser.cmx parsing/lexer.cmx parsing/parse.cmx parsing/printast.cmx typing/unused_var.cmx typing/ident.cmx typing/path.cmx typing/primitive.cmx typing/types.cmx typing/btype.cmx typing/oprint.cmx typing/subst.cmx typing/predef.cmx typing/datarepr.cmx typing/env.cmx typing/typedtree.cmx typing/ctype.cmx typing/printtyp.cmx typing/includeclass.cmx typing/mtype.cmx typing/includecore.cmx typing/includemod.cmx typing/parmatch.cmx typing/typetexp.cmx typing/stypes.cmx typing/typecore.cmx typing/typedecl.cmx typing/typeclass.cmx typing/typemod.cmx bytecomp/lambda.cmx bytecomp/printlambda.cmx bytecomp/typeopt.cmx bytecomp/switch.cmx bytecomp/matching.cmx bytecomp/translobj.cmx bytecomp/translcore.cmx bytecomp/translclass.cmx bytecomp/translmod.cmx bytecomp/simplif.cmx bytecomp/runtimedef.cmx bytecomp/meta.cmx bytecomp/instruct.cmx bytecomp/bytegen.cmx bytecomp/printinstr.cmx bytecomp/opcodes.cmx bytecomp/emitcode.cmx bytecomp/bytesections.cmx bytecomp/dll.cmx bytecomp/symtable.cmx bytecomp/bytelink.cmx bytecomp/bytelibrarian.cmx bytecomp/bytepackager.cmx driver/pparse.cmx driver/errors.cmx driver/compile.cmx driver/main_args.cmx driver/main.cmx
asmrun/meta.o asmrun/dynlink.o -cclib "-lm -ldl -ltinfo -lpthread"
bytecomp/bytegen.o: In function camlBytegen__comp_function_1015': (.text+0x669c): undefined reference to .umul'
typing/printtyp.o: In function camlPrinttyp__new_name_427': (.text+0x26d8): undefined reference to .div'
typing/printtyp.o: In function camlPrinttyp__new_name_427': (.text+0x2700): undefined reference to .rem'
typing/ctype.o: In function camlCtype__hash_319': (.text+0x6f74): undefined reference to .umul'
typing/btype.o: In function camlBtype__hash_variant_275': (.text+0xc38): undefined reference to .umul'
parsing/lexer.o: In function camlLexer__char_for_decimal_code_241': (.text+0x458): undefined reference to .umul'
parsing/lexer.o: In function camlLexer__char_for_decimal_code_241': (.text+0x4b8): undefined reference to .umul'
stdlib/stdlib.a(array.o): In function camlArray__trickleup_205': (.text+0x1074): undefined reference to .div'
stdlib/stdlib.a(array.o): In function camlArray__sort_179': (.text+0x3140): undefined reference to .div'
stdlib/stdlib.a(char.o): In function camlChar__escaped_66': (.text+0x158): undefined reference to .div'
stdlib/stdlib.a(char.o): In function camlChar__escaped_66': (.text+0x17c): undefined reference to .div'
stdlib/stdlib.a(char.o): In function camlChar__escaped_66': (.text+0x184): undefined reference to .rem'
stdlib/stdlib.a(char.o): In function camlChar__escaped_66': (.text+0x1a4): undefined reference to .rem'
stdlib/stdlib.a(string.o): In function camlString__concat_94': (.text+0x594): undefined reference to .umul'
stdlib/stdlib.a(string.o): In function camlString__escaped_108': (.text+0x9d4): undefined reference to .div'
stdlib/stdlib.a(string.o): In function camlString__escaped_108': (.text+0xa0c): undefined reference to .div'
stdlib/stdlib.a(string.o): In function camlString__escaped_108': (.text+0xa14): undefined reference to .rem'
stdlib/stdlib.a(string.o): In function camlString__escaped_108': (.text+0xa48): undefined reference to .rem'
stdlib/stdlib.a(sys.o): In function camlSys__entry': (.text+0x19c): undefined reference to .umul'
stdlib/stdlib.a(hashtbl.o): In function camlHashtbl__insert_bucket_96': (.text+0x3a0): undefined reference to .rem'
stdlib/stdlib.a(hashtbl.o): In function camlHashtbl__add_207': (.text+0x8f4): undefined reference to .rem'
stdlib/stdlib.a(hashtbl.o): In function camlHashtbl__remove_213': (.text+0xac4): undefined reference to .rem'
stdlib/stdlib.a(hashtbl.o): In function camlHashtbl__find_226': (.text+0xc88): undefined reference to .rem'
stdlib/stdlib.a(hashtbl.o): In function camlHashtbl__find_all_238': (.text+0xfa8): undefined reference to .rem'
stdlib/stdlib.a(hashtbl.o):(.text+0x10d4): more undefined references to .rem' follow stdlib/stdlib.a(printf.o): In function camlPrintf__get_int_litteral_279':
(.text+0x1fe4): undefined reference to .umul' stdlib/stdlib.a(random.o): In function camlRandom__full_init_68':
(.text+0x2b0): undefined reference to .rem' stdlib/stdlib.a(random.o): In function camlRandom__full_init_68':
(.text+0x2d4): undefined reference to .rem' stdlib/stdlib.a(random.o): In function camlRandom__bits_89':
(.text+0x518): undefined reference to .rem' stdlib/stdlib.a(random.o): In function camlRandom__bits_89':
(.text+0x56c): undefined reference to .rem' stdlib/stdlib.a(random.o): In function camlRandom__intaux_92':
(.text+0x614): undefined reference to .rem' stdlib/stdlib.a(random.o):(.text+0x708): more undefined references to .rem' follow
stdlib/stdlib.a(weak.o): In function camlWeak__loop_171': (.text+0x3c0): undefined reference to .umul'
stdlib/stdlib.a(weak.o): In function camlWeak__get_index_124': (.text+0x8e0): undefined reference to .rem'
stdlib/stdlib.a(weak.o): In function camlWeak__next_sz_156': (.text+0xc14): undefined reference to .umul'
collect2: ld returned 1 exit status
Error during linking
make: *** [ocamlc.opt] Error 2

@vicuna
Copy link
Author

vicuna commented Nov 12, 2007

Comment author: @xavierleroy

OCaml's native-code generator cannot generate Sparc 64 bits code. An unofficial port for Sparc64/Solaris exists (http://www.mit.edu/~jfc/) but was never integrated in the trunk by lack of resources. So, you're stuck with bytecode only. I'll try to fix the configure script so that it turns native compilation off on Sparc in 64-bit mode.

@vicuna vicuna closed this as completed Nov 12, 2007
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant