Permalink
Browse files

Link libgcc.a

This is needed on ARM. Without it, you get:

_build/main.native.o: In function `.L104':
camlinternalOO.o:(.text+0xb36c): undefined reference to `__aeabi_dcmpge'
camlinternalOO.o:(.text+0xb3a0): undefined reference to `__aeabi_dadd'
...
  • Loading branch information...
talex5 committed Jun 3, 2014
1 parent ada8268 commit c17f2f60a6309322ba45cecb00a808f62f05cf82
Showing with 3 additions and 2 deletions.
  1. +1 −1 README.md
  2. +2 −1 lib/mirage.ml
@@ -26,7 +26,7 @@ To work with Mirage, you'll need the following prerequisites installed:
* a working [OCaml](http://ocaml.org) compiler (4.00.1 or higher).
* the [OPAM](https://opam.ocaml.org) source package manager (1.1.1 or higher).
* a 64-bit Linux host to compile Xen kernels, or FreeBSD, OpenBSD or MacOS X
* an x86\_64 or armel Linux host to compile Xen kernels, or FreeBSD, OpenBSD or MacOS X
for the userlevel version.
There are three stages to using `mirage`:
@@ -1501,7 +1501,8 @@ let configure_makefile t =
append oc "\tld -d -static -nostdlib --start-group \\\n\
\t $(shell pkg-config --static --libs openlibm libminios) \\\n\
\t _build/main.native.o %s/libocaml.a \\\n\
\t %s/libxencaml.a --end-group -o mir-%s.xen"
\t %s/libxencaml.a --end-group \\\n\
\t $(shell gcc -print-libgcc-file-name) -o mir-%s.xen"

This comment has been minimized.

@hannesm

hannesm May 22, 2016

Member

can we contain linking of libgcc.only on arm? (my local test on amd64 to remove this line from the Makefile resulted in a working xen MirageOS unikernel)

This comment has been minimized.

@talex5

talex5 May 24, 2016

Contributor

We could probably get away with this, given the current output of gcc on amd64. What would be the benefit?

This comment has been minimized.

@samoht

samoht May 24, 2016

Member

I think the rational is: https://berlin.ccc.de/~hannes/mirage-console-xen-bytes-full.svg (mirage console blobs on xen)

This comment has been minimized.

@talex5

talex5 May 24, 2016

Contributor

I wonder why it linked it all in (assuming that's what the diagram shows), if it's not using any symbols from it?

This comment has been minimized.

@hannesm

hannesm Jun 1, 2016

Member

just to be clear, the treemap is generated by replacing the linker, thus it does not include magic (not linking in some objects/archives) done by the linker... it is rather an overapproximation.. imho the libgcc depedency is not a nice one (and we'll need a plan for solo5 which afaics can also be built using clang), but restricting it to arm backend sounds sensible to me.

This comment has been minimized.

@talex5

talex5 Jun 2, 2016

Contributor

This is the Xen code, so it shouldn't affect solo5.

lib lib t.name;
| `Unix ->
append oc "build: main.native";

0 comments on commit c17f2f6

Please sign in to comment.