Adding a custom library to l4/pkg/bootstrap

Martin Küttler martin.kuettler at gmail.com
Thu Sep 4 09:27:20 CEST 2014


On 09/03/2014 09:51 AM, Masti Ramya Jayaram wrote:
> Hey Jan,
>
> Sorry for underspecifying it. Here are the details.
>
> I have a library called scc-sec under the l4/pkg directory. It has one file:
>
> a. init.c that contains
>
> void hello(){
>    printf("hello");
> }
>
> I compile this as a library and I can see the scc-sec.so and scc-sec.a in the l4/build/pkg/scc-sec directory
>
> Now in l4/pkg/bootstrap:
>
> a. Control file
> requires: (added) scc-sec
>
> b. Make.rules:
> -lscc-sec

Is "-lscc-sec" the literal content of this file? That doesn't do anything.

>
> c. startup.cc
>
> I declare the function as:
>
> extern "C" {
> void hello();
> }
>
> and somewhere in startup() function, I call it
>
> hello();
>
> On trying to compile this, I get (exact error as it is compiled)
>
> in path_to-startup.cc: undefined reference to function "hello()"
>
> I do not think it is the printf because it explicitly gives me an undefined reference to hello :)

To me this looks like you don't actually link to your scc-sec library. 
Does your Makefile for bootstrap include something like
REQUIRES_LIBS = scc_sec
?

Martin




More information about the l4-hackers mailing list