LibC.a usage in /usr/lib/boot/chrp.disk.proto


 
Thread Tools Search this Thread
Operating Systems AIX LibC.a usage in /usr/lib/boot/chrp.disk.proto
# 1  
Old 02-27-2013
IBM LibC.a usage in /usr/lib/boot/chrp.disk.proto

Hi,

I am new to C programming, In my protofile we are adding libC.a entry.
I want to know about the usage of libC.a in ptotofile, we are doing this modification before taking bosboot image.

I tried to take a bosboot image without libC.a entry in protofile. I didn't observed any difference in both the cases.

Can someone should brief me the usage of libC.a in /usr/lib/boot/chrp.disk.proto.

Thanks,
# 2  
Old 03-01-2013
Well, libC.a is a static (compile-time) linkable object library to support system functions written in the matching compiler. It is actually an ar archive of many *.o files compiled from *.cpp, assuming capital C implies C++. Only the referenced code is copied out of the library into your executable, not necessarily the entire file. It can be reworked into a libC.so dynamic, shared object (run-time and read-only parts in shared RAM/VM pages paged direct from the .so, no swap used) library. But really, .o, and hence .a and .so, could come from any mix of compilers and languages, as long as everyone agrees on call stack atructure and such.

I assume this reference is to make sure it is linked into the kernel, which might have to run in a primitive mode that does not support dynamic, shared object library. UNIX systems primarily depend on libc.so, which supports the c language, and is usable in C++ using 'extern "C" {...}' declaration wrappers. The C++ variable names are mangled to code in a check for the type and if a call the argument number and each type. This tells C++ not to mangle c calls and variables. The reciprocal 'extern "C++"{...}' tells the C compiler to mangle to call C++ names.
# 3  
Old 03-01-2013
The answer to your question, more to the point, is that libC.a, or any other file, is not needed unless the file is needed for the system boot.

So, until you add something that is used during the boot phase (e.g., a new device driver) it will not make any difference - because this file system gets mounted over by the disk version of / (root) (phase 2 of AIX boot, aka varyonvg rootvg phase).

To know more about the file layout, and the meaning of the content entries - read the manpage proto

excerpt:
Code:
Description

       The proto command creates a prototype file for a file system or part of
       a file system. The mkfs command uses the prototype file as input to
       construct a file system according to a predefined template. The
       prototype file consists of a recursive directory listing of every file
       on the file system, with its owner, group, and protection. It also
       contains the file from which the prototype file is to be initialized,
       formatted as described in the mkfs command.

# 4  
Old 03-04-2013
Hi Michael & DG,

Thanks for your valuable suggestions. Now I got some clear picture about libC.a and protofile.

One small doubt, is it useful to add the libC.a in protofile?
What it will do during system boot up, I mean how can kernel interact with the libC.a during system boot up.

Thanks in advance.

---------- Post updated at 11:56 AM ---------- Previous update was at 11:45 AM ----------

Hi Michael and DG,

Actually I am facing the below error when I have libC.a entry in protofile.

dd: 0511-053 The write failed.
: There is a request to a device or address that does not exist.
67611+1 records in.
1056+1 records out.
Failed to take a bosboot image:

Without libC.a entry there is no problem with bosboot.

Thanks.
# 5  
Old 03-05-2013
Maybe the libC.a file is not where it was told?
# 6  
Old 03-12-2013
Hi,

libC.a file is there in its default location and the soft link also created.

# ls -l /usr/lib/libC.a
lrwxrwxrwx 1 bin bin 23 Feb 28 13:28 /usr/lib/libC.a -> /usr/lpp/xlC/lib/libC.a


Thanks,
# 7  
Old 03-12-2013
Well, we are talking about it being included in, by being statically linked to, the boot kernel, not the final, booted system. It is a static lib, so there is no need for the full file at boot time. Some apps are not symlink friendly.
This User Gave Thanks to DGPickett For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. BSD

FreeBSD: /usr/bin/ld not looking in /usr/local/lib

I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries. I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble: $ ./autogen.sh checking... (2 Replies)
Discussion started by: AntumDeluge
2 Replies

2. UNIX for Advanced & Expert Users

/usr/lib/libv12n.so

Hi, I want to use the function "v12n_domain_uuid" on solaris box. The library "libv12n" is present in /usr/lib but i can't locate the header "libv12n.h" anywhere in the box. How do i run the API "v12n_domain_uuid" (4 Replies)
Discussion started by: skyineyes
4 Replies

3. Red Hat

./Vega6: /lib/libc.so.6: version `GLIBC_2.15' not found (required by ./Vega6)

Hello, I am trying to run a chess pairing program called Vega Chess on RHEL 6.5 Server $ uname -a Linux CDMA 2.6.32-431.el6.i686 #1 SMP Sun Nov 10 22:20:22 EST 2013 i686 i686 i386 GNU/Linux $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (Santiago)This is the way I... (6 Replies)
Discussion started by: Ferocci
6 Replies

4. Solaris

/usr/lib/vhost.so missing Solaris 5.10

Hi, i have a solaris 5.10 machine on which i am getting below error while executing cat command ld.so.1: cat: fatal: vhost.so: open failed: No such file or directory Killed it is related to file vhost.so missing Also when i did ldd cat result is as below libc.so.1... (1 Reply)
Discussion started by: Jcpratap
1 Replies

5. UNIX for Dummies Questions & Answers

use of /usr/lib/nsr

Hello, I have this folder on my one of the machine but not on other. /usr/lib/nsr can anyone tell me for what this folder is used ? Thanks (2 Replies)
Discussion started by: yatrik007
2 Replies

6. HP-UX

Core Dump in /usr/lib/hpux32/libc.so.1

Hi, I am working on a core dump issue, where the dumps happens in OS library, /usr/lib/hpux32/libc.so.1 and version for my OS is as specified by uname -a is: "HP-UX B.11.23 U ia64". Below is the core dump file. Our program terminated with Signal 6. ... (0 Replies)
Discussion started by: vivek.gkp
0 Replies

7. AIX

Getting Symbol resolution failed for ../../../lib/libc.a Error

Hi I have compiled a binary on AIX 5.3.0.0 but when i run i get following error Could not load program ACE_wrappers/bin/gperf: Symbol resolution failed for ../../../lib/libc.a(posix_aio.o) because: Symbol _posix_kaio_rdwr (number 2) is not exported from dependent module... (0 Replies)
Discussion started by: khan_nayeem
0 Replies

8. UNIX for Advanced & Expert Users

/usr/lib on a seperate partition

I want to move /usr/lib on a seperate partition. ( is is now all at / ) I know how to copy data and update fstab but... At boot time, the mepis distro already needs stuff from /usr/lib but it is not mounted yet. So i get error before /usr/lib is mounted. Does this mean you cannot move... (4 Replies)
Discussion started by: progressdll
4 Replies

9. Shell Programming and Scripting

sh script to traul through /usr/lib/perl5 ...

Hey, Im trying to create a script to create a dir-tree of pod converted to html. so far this is the script: #!/bin/sh cd /usr/lib/perl5 for d in ./* ; do # is it a dir? if ; then # yes! get the basename cd $d ; dir=`basename $d` for f in ./* ; do ... (1 Reply)
Discussion started by: emcb
1 Replies

10. UNIX for Dummies Questions & Answers

/usr/lib/32/32-> Question

Hello UNIX people. I was just cruising around my UFS and came across the directory /usr/lib/32. This directory continues up many directories (/usr/lib/32/32/32/32->). Each level of 32/ directory seems to be a copy of the previous one. I have been working with UNIX for a little while now, but I... (3 Replies)
Discussion started by: shaggy
3 Replies
Login or Register to Ask a Question