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

Wrong ASPPFLAGS on HPUX #3937

Closed
vicuna opened this issue Dec 29, 2005 · 12 comments
Closed

Wrong ASPPFLAGS on HPUX #3937

vicuna opened this issue Dec 29, 2005 · 12 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Dec 29, 2005

Original bug ID: 3937
Reporter: abergou
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2006-08-30T11:29:33Z)
Resolution: won't fix
Priority: normal
Severity: minor
Version: 3.09.0
Category: ~DO NOT USE (was: OCaml general)
Monitored by: "Christoph Bauer"

Bug description

On HPUX OCaml sets in config/Makefile

ASPPFLAGS="-traditional -c -DSYS_hpux"

Then compilation fails, see additional information.

ASPPFLAGS=" -c -DSYS_hpux"

seems to work.

Christoph Bauer

Additional information

cc -O -traditional -c -DSYS_hpux -o hppa.o hppa.S ||
{ echo "If your assembler produced syntax errors, it is probably unhappy with the"; echo "preprocessor. Check your assembler, or try producing hppa.o by hand."; exit 2; }
cc: error 1400: Option t usage: -t c,name where c may be 1 or more of pc0al.
If your assembler produced syntax errors, it is probably unhappy with the
preprocessor. Check your assembler, or try producing hppa.o by hand.
make[1]: *** [hppa.o] Error 2
make[1]: Leaving directory `/projekte/backup/tools/unix/build/ocaml/ocaml-3.09.0/asmrun'

File attachments

@vicuna
Copy link
Author

vicuna commented Dec 29, 2005

Comment author: anonymous

Aehmm... I should use gcc...

@vicuna
Copy link
Author

vicuna commented Dec 29, 2005

Comment author: anonymous

gcc and gnu-as (2.15):

make opt.opt fails:

Warning Y: unused variable bp.
File "pa_o_fast.ml", line 6868, characters 6-8:
Warning Y: unused variable bp.
File "pa_o_fast.ml", line 6895, characters 6-8:
Warning Y: unused variable bp.
File "pa_o_fast.ml", line 7147, characters 26-40:
Warning Y: unused variable s.
File "pa_o_fast.ml", line 7155, characters 30-43:
Warning Y: unused variable s.
File "pa_o_fast.ml", line 7590, characters 6-8:
Warning Y: unused variable bp.
File "pa_o_fast.ml", line 7622, characters 6-8:
Warning Y: unused variable bp.
File "pa_o_fast.ml", line 9539, characters 38-52:
Warning Y: unused variable s.
File "pa_o_fast.ml", line 9547, characters 42-55:
Warning Y: unused variable s.
/tmp/camlasmc78a76.s: Assembler messages:
/tmp/camlasmc78a76.s:99061: Error: Field out of range [-262144..262143] (-267008).
Assembler error, input left in file /tmp/camlasmc78a76.s
make[2]: *** [pa_o_fast.cmx] Error 2
make[2]: Leaving directory /projekte/backup/tools/unix/build/ocaml/ocaml-3.09.0/camlp4/compile' make[1]: *** [opt.opt] Error 2 make[1]: Leaving directory /projekte/backup/tools/unix/build/ocaml/ocaml-3.09.0/camlp4'
make: *** [camlp4optopt] Error 2

@vicuna
Copy link
Author

vicuna commented Dec 29, 2005

Comment author: anonymous

get segfaults (e.g. ocamlfind with some options) on HPUX :-((

@vicuna
Copy link
Author

vicuna commented Jan 2, 2006

Comment author: Christoph Bauer

BTW, ocaml-3.08.3 runs fine.

cb@snoopy:/home/users/bauer: gdb which ocamlrun
HP gdb 3.2 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.2 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) r which camlp4
Starting program: /T/tools/unix/hp7u11/bin/ocamlrun which camlp4

Program received signal SIGSEGV, Segmentation fault.
0x22c08 in caml_modify+0x44 ()
(gdb) where
#0 0x22c08 in caml_modify+0x44 ()
#1 0x1dbbc in caml_interprete+0xabc ()
#2 0x20378 in caml_main+0x278 ()
#3 0xbb30 in main+0x10 ()
(gdb)

@vicuna
Copy link
Author

vicuna commented Jan 3, 2006

Comment author: @xavierleroy

The HPPA port of OCaml has always been very sensitive to the toolchain
used. Moreover, we've long lost access to an HPPA machine, therefore
this port is essentially unsupported. I can try to help if
given more context for the crashes, but can't fix anything by myself.

@vicuna
Copy link
Author

vicuna commented Jan 3, 2006

Comment author: Christoph Bauer

Ok then I try to activate support for dynamic linking.

config/Makefile
SUPPORTS_SHARED_LIBRARIES=true
SHAREDCCCOMPOPTS=-fPIC
MKSHAREDLIB=gcc -shared -o
MKSHAREDLIBRPATH=-rpath

config/s.h
#define SUPPORT_DYNAMIC_LINKING

$ make install
$ ocaml unix.cma
Cannot load required shared library dllunix.
Reason: Unresolved symbol: caml_local_roots (data) from /T/tools/unix/hp7u11/lib/ocaml/stublibs/dllunix.so.

$ nm which ocamlrun | grep caml_local_roots
40005db8 B caml_local_roots

@vicuna
Copy link
Author

vicuna commented Jan 4, 2006

Comment author: anonymous

No success with gcc-3.4.5 :-(

The optimized build (e.g. "$ ocaml") leads to an segmention fault.

@vicuna
Copy link
Author

vicuna commented Jan 4, 2006

Comment author: Christoph Bauer

The native ocaml compiler looks quite good. I could succesfully compile a larger program with ocamlopt.opt.

@vicuna
Copy link
Author

vicuna commented Jan 4, 2006

Comment author: Christoph Bauer

I tested ocaml-3.08.2 again. It has the segmentation problems like ocaml-3.09.0
too.

@vicuna
Copy link
Author

vicuna commented Apr 19, 2006

Comment author: Christoph Bauer

(Next round with OCaml-3.09.2 and gcc-4.1.0)

The assembler error message (label address to large) disappears
if I compile pa_o_fast.ml with -compact flag. But then linking fails:

/usr/ccs/bin/ld: Target of unconditional branch is out of range
Reference from: ../compile/pa_o_fast.o(0x3ffdc)
/usr/ccs/bin/ld: Target of unconditional branch is out of range
Reference from: ../compile/pa_o_fast.o(0x401f4)
/usr/ccs/bin/ld: Invalid fixups exist
collect2: ld returned 1 exit status

@vicuna
Copy link
Author

vicuna commented Apr 20, 2006

Comment author: Christoph Bauer

Good news: the ld error disappears, if everything (camlp4+stdlib) is compiled with -compact -inline 0.

@vicuna
Copy link
Author

vicuna commented Aug 30, 2006

Comment author: @xavierleroy

To summarize: all problems but one go away with an appropriate choice of toolchain. The remaining problem (branches out of range for large function definitions) is an ocamlopt problem, and would need to be addressed like we did in the PowerPC code generator. However, lack of access to an HPPA machine (and of general interest for this architecture) means that this will probably never be done. I'm therefore closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants