I picked up a neat trick on the Solaris linker mailing list this week. If you want to see the complete set of input files that are processed by the runtime linker, you can use the “-Dfiles” LD_OPTION:
$ LD_OPTIONS=-Dfiles /usr/sfw/bin/gcc -o foo foo.c
debug:
debug: file=/usr/lib/crt1.o [ ET_REL ]
debug:
debug: file=/usr/lib/crti.o [ ET_REL ]
debug:
debug: file=/usr/lib/values-Xa.o [ ET_REL ]
debug:
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/crtbegin.o [ ET_REL ]
debug:
debug: file=/var/tmp//cclLa4fy.o [ ET_REL ]
debug:
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc.a [ archive ]
debug:
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc_eh.a [ archive ]
debug:
debug: file=/usr/lib/libc.so [ ET_DYN ]
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc.a reusing: originally processed as /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc.a
debug:
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc.a [ archive ]
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc_eh.a reusing: originally processed as /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc_eh.a
debug:
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/libgcc_eh.a [ archive ]
debug:
debug: file=/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/crtend.o [ ET_REL ]
debug:
debug: file=/usr/lib/crtn.o [ ET_REL ]
debug:
The Solaris linker provides numerous other debugging options, and the full list can be viewed by running ld with the “-Dhelp” option:
$ /usr/ccs/bin/ld -Dhelp
debug:
debug: Runtime Linking
debug: Diagnostics that trace the runtime linking of an application can be
debug: enabled to stderr by using the environment variable setting:
debug: LD_DEBUG=token1,token2 app ...
debug: Alternatively, the diagnostics can be redirected to an output file
debug: using the additional environment variable:
debug: LD_DEBUG_OUTPUT=file
debug: The output file is given the specified name and the process id as a
debug: suffix.
debug:
< ..... >
Kickstart is a super useful techology for performing Linux installations. Typically when you type linux ks=XXX from the boot menu:
boot: linux ks=floppy:/ks.cfg
The host will use DHCP to acquire an IP address. If a DHCP server isn’t available on the network you want to perform the kickstart on, you can forego DHCP and assign a static IP address by appending the “ip=,” “netmask=,” “gateway=” and “dns=” options to the kickstart command line:
boot: linux ks=flopp:/ks.cfg ip=192.168.1.10 netmask=255.255.255.0 gateway=192.168.1.1 dns=192.168.1.1
This can come in handy!
Building OpenLDAP on Solaris hosts that use /opt as their software repository can sometimes be a chore. In case anyone finds this useful, here is the procedure I use:
$ LD_LIBRARY_PATH=/opt/openssl/lib:/opt/BerkeleyDB/lib:/usr/sfw/lib:/usr/lib
$ export LD_LIBRARY_PATH
$ export LDFLAGS="-L/opt/BerkeleyDB/lib -L/opt/openssl/lib"
$ export LDFLAGS
$ export CPPFLAGS="-I/opt/BerkeleyDB/include -I/opt/openssl/include"
$ export CPPFLAGS
$ configure --prefix=/opt/openldap-2.3.24 --enable-bdb --with-tls --enable --monitor --disable-ipv6
$ make depend && make
I recently started playing around with OpenVZ, which is a lighweight virtualization engine for Linux. The OpenVZ developers must like what they see in the Sun niagra processor, since they are actively working to port OpenVZ to the niagra. This is great news, since OpenVZ has the most potential IMHO of all of the Linux vitualization technologies (e.g., Xen, KVM, etc.). Tis good stuff!
I came across a few nifty articles on PCI, interrupt handlers, FB-DIMM and debugging this week:
PCI for developers: http://docs.sun.com/app/docs/doc/819-3196/6n5ed4gua?a=view#hwovr-22
Advanced interrupt handlers: http://developers.sun.com/solaris/articles/interrupt_handlers.html
When Linux runs out of memory:
http://www.linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html
Introducing FB-DIMMM memory:
http://www.pcstats.com/articleview.cfm?articleID=1812
Signals as a Linux debugging tool:
http://www-128.ibm.com/developerworks/power/library/l-sigdebug.html?ca=dgr-lnxw07SignalsLinuxDebug