How to install libsys.a

522 views
Skip to first unread message

Tiberiu Turbureanu

unread,
Apr 3, 2011, 5:50:41 PM4/3/11
to min...@googlegroups.com
Hi,

How can one install a new libsys.a from source directory
/usr/src/lib/libsys/ to system directory /usr/lib/?

I even tried `make world', but the timestamp of /usr/lib/libsys.a is
still old and I cannot find in the binary the string with the name of
the new syscall I added (sys_example, with implementation in
sys_example.c).

Or maybe I shouldn't expect to be installed in /usr/lib but instead to
be blended in the new image? Please note I need to call sys_example
from a sample driver (in which I included <minix/syslib.h>).

Tibi

Erik van der Kouwe

unread,
Apr 4, 2011, 1:44:37 AM4/4/11
to minix3
There are two sets of librararies for two different compilers. To
update both you should make th gnu-libraries and ack-libraries
targets.

With kind regards,
Erik

Tiberiu Turbureanu

unread,
Apr 4, 2011, 1:51:20 AM4/4/11
to min...@googlegroups.com
On Sun, 3 Apr 2011 22:44:37 -0700 (PDT), Erik van der Kouwe wrote:
> Hi,
>
>> How can one install a new libsys.a from source directory
>> /usr/src/lib/libsys/ to system directory /usr/lib/?

> There are two sets of librararies for two different compilers. To


> update both you should make th gnu-libraries and ack-libraries
> targets.

I need to install libsys.a, after I compiled it with ack. Isn't it
then an ack-library and `make libraries' should install it in the
system?

Thanks,
Tibi

Vivek Prakash

unread,
Apr 4, 2011, 2:00:23 AM4/4/11
to min...@googlegroups.com
Hi,

On Mon, Apr 4, 2011 at 3:20 AM, Tiberiu Turbureanu
<tiberiut...@gmail.com> wrote:
> How can one install a new libsys.a from source directory
> /usr/src/lib/libsys/ to system directory /usr/lib/?

You need to add sys_example.c to Makefile:
SRCS+=sys_example.c

Then doing 'make clean install' in /usr/src/lib/libsys should compile
the libsys and install it in /usr/lib.
If you want to install it at some other place so as to leave the
original libsys.a intact, you can do
'make LIBDIR=/usr/<custom-lib-dir> install' .
Later you can manually link the program using this lib during compilation.


~
Vivek Prakash

Vivek Prakash

unread,
Apr 4, 2011, 2:07:31 AM4/4/11
to min...@googlegroups.com
On Mon, Apr 4, 2011 at 11:30 AM, Vivek Prakash <vivek....@gmail.com> wrote:
> Then doing 'make clean install' in /usr/src/lib/libsys should compile
> the libsys and install it in /usr/lib.

Aha, doing 'make clean install' would install the libsys.a in
/usr/lib/${MACHINE_ARCH} .
If MACHINE_ARCH=i386 for your system, the libsys.a will go in /usr/lib/i386 .


~
Vivek Prakash

Tiberiu Turbureanu

unread,
Apr 4, 2011, 2:20:50 AM4/4/11
to min...@googlegroups.com

Indeed the timestamp is new for /usr/lib/i386/libsys.a. Running `file
/usr/lib/libsys.a' I got 'MINIX-PC gnu archive' so the gnu-library is
installed in /usr/lib.

Thank you,
Tibi

Vivek Prakash

unread,
Apr 4, 2011, 2:50:02 AM4/4/11
to min...@googlegroups.com
Hi,

On Mon, Apr 4, 2011 at 11:50 AM, Tiberiu Turbureanu
<tiberiut...@gmail.com> wrote:
> Indeed the timestamp is new for /usr/lib/i386/libsys.a. Running `file
> /usr/lib/libsys.a' I got 'MINIX-PC gnu archive' so the gnu-library is
> installed in /usr/lib.

This is understandable. When you directly installed the libsys, you
implicitly used the inbuilt ACK compiler in MINIX. However, as Erik
pointed out that there are two different sets of libraries for two
different compilers, you should do 'sh /usr/src/lib/gnu_build.sh obj
depend all install' in /usr/src/lib/libsys to update the gnu library
/usr/lib/libsys.a

~
Vivek Prakash

Antoine LECA

unread,
Apr 4, 2011, 4:20:41 AM4/4/11
to min...@googlegroups.com
Tiberiu Turbureanu wrote:
> How can one install a new libsys.a from source directory
> /usr/src/lib/libsys/ to system directory /usr/lib/?

Only if it is a GNU-type library, as you have now understood!


However the general command to just update a library after doing some
change has not been explained: assuming you are in /usr/src/lib/libfoo
which you are rebuilding, and depending on the compiler you are using:
$ sh ../ack_build.sh install
$ sh ../clang_build.sh install
$ sh ../elf_build.sh install
$ sh ../gcc_build.sh install

If you are modifying an ACK-specific library, then you are in
/usr/src/lib/ack/libbar and you'll use instead
$ sh ../../ack_build.sh install

This is because 'make install' (which copies libfoo.a to its
destination) "does the right thing" and embeds 'make all' (makes sure
the *.o are up-to-date, and rebuilds libfoo.a)

Note however:
- that this state of things would evolve: the plan is to drop this
stuff as soon as the compiler and libraries change to the upper-standard
ones, i.e. no-more-ACK, ELF, NetBSD things;
- that you need to have done a full first pass with the same compiler
before (which will take care of the needed make obj, make depend steps)
- that this could work only to changes done to the library sources; if
doing any change to the public headers (include files), you need to run
a full "make includes" or "make gnu-includes" from the top-level
/usr/src/Makefile


Someone suggested earlier: "make clean"; this is a huge loss of time,
since all the *.o will be recompiled. In fact, it will be almost surely
slacker than issuing "make xxx-libraries" from the top level.


Antoine

Reply all
Reply to author
Forward
0 new messages