09-05-2008
gcc & linker question (Solaris 10)
Hi,
I'm confused about the GCC & Linking process could somebody please briefly explain?
I have GCC 3.4.6 installed from SunFreeware. Reading the narrative alongside the package states "It was compiled to use the SUN assembler and loader usually in /usr/ccs/bin if the SUNW developer packages are installed."
SUNW developer packaes are installed and ld / as / ar are in the relevant /usr/ccs/bin directory.
I also have the GNUbinutils package installed which installs ld / as / ar in /usr/local/bin. this /usr/local/bin dir precedes / usr/ccs/bin in my $PATH.
When installing third party applications, i commonly see:
./configure \
--with-gnu-ld \
--with-gnu-as \
which i specify & the applications install and work okay, however:
checking config.log shows
Reading specs from /usr/local/lib etc etc etc
Configure with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin
whats going on?
Thanks
Nick
10 More Discussions You Might Find Interesting
1. Programming
Hi Together,
while compiling my program with CC I get the following Error message from the Linker:
Undefined first referenced
symbol in file
std::basic_string<char,std::char_traits<char>,std::allocator<char>... (2 Replies)
Discussion started by: nik
2 Replies
2. UNIX for Dummies Questions & Answers
I just installed SUSE Linux 10.0 on my computer but when I typed " emacs & " and " gcc -c main.c" in the terminal, those programs couldn't be found. So the Linux install package does not install those programs by default? (2 Replies)
Discussion started by: whutes
2 Replies
3. Shell Programming and Scripting
Hi,
I am trying to compile a .c file but in the pre-processor directives I want to include a file that I have put together myself (#include "file.h"). How can I accomplish this? (3 Replies)
Discussion started by: sanchopansa
3 Replies
4. UNIX for Advanced & Expert Users
Folks;
I'm trying to install gcc-3.4.6 & install SWIG tool on Solaris 10 (Sparc), but when i try to run make for gcc i got this error below:
make: Fatal error: Command failed for target `all-gcc'
and when i try to run "make install" to install swig, i got this error:
*** Error code 2... (10 Replies)
Discussion started by: moe2266
10 Replies
5. Programming
Im trying to compile some code that involves using X-Windows based functions (XDisplayName() and XOpenDisplay() ), however each time I run the compiler, Im getting a problem with the linker.
The linker says that both XDisplayName() and XOpenDisplay() are unresolved text symbols. Is there a... (1 Reply)
Discussion started by: JamesGoh
1 Replies
6. Solaris
I'm trying to build cdrkit-1.1.9 but have the same problem with 1.1.6 as well. The reason I need cdrkit is that it has an extended Joilet that mkisofs doesn't have but if anyone has another program that can provide this that might be a work around I can use.
The problem I'm having is when I... (1 Reply)
Discussion started by: dxk3355
1 Replies
7. Programming
Hi,
I do not use the default linker, and instead us another one and pass this argument -Wl,--dynamic-linker=<path to linker> to gcc when compiling. However, what happens if the linker is not under /lib and /lib64 and I am not able to create a symlink to the linker in /lib or /lib64 due to no... (2 Replies)
Discussion started by: Shompis
2 Replies
8. Programming
Hai,
I have two (Pgm1.c and Pgm2.c) simple programs, which is compiled using gcc. Now we have two exe's (Pgm1 and Pgm2). When i executed the nm Pgm1 and nm Pgm2, in the listed symbols the address of main is same for both programs (08048344 T main) at run time also.
Doubt:
1) What is this... (3 Replies)
Discussion started by: rajamohan
3 Replies
9. Programming
I have a build where I wish to link against and load a specific version of a library and a different version of the same library is installed on the system. I'm using a -L option to point to the version that I wish to link against but gcc still seems to choose the installed version. Is there a way... (4 Replies)
Discussion started by: Richard Johnson
4 Replies
10. Solaris
Hi guys,
I am really new to Solaris. My question is about the patching package management. Now I was provided some old packages within that there are hard-coded codes written with commands like "patchadd", so anyway I can make them work with Solaris 11?
Cheers! (8 Replies)
Discussion started by: ethanzhou
8 Replies
LEARN ABOUT OPENDARWIN
lint
lint(1B) SunOS/BSD Compatibility Package Commands lint(1B)
NAME
lint - C program verifier
SYNOPSIS
/usr/ucb/lint [options]
DESCRIPTION
/usr/ucb/lint is the interface to the BSD Compatibility Package C program verifier. It is a script that looks for the link
/usr/ccs/bin/ucblint to the C program verifier. /usr/ccs/bin/ucblint is available only with the SPROcc package, whose default location is
/opt/SUNWspro. /usr/ucb/lint is identical to /usr/ccs/bin/ucblint, except that BSD headers are used and BSD libraries are linked before
base libraries. The /opt/SUNWspro/man/man1/lint.1 man page is available only with the SPROcc package.
OPTIONS
/usr/ucb/lint accepts the same options as /usr/ccs/bin/ucblint, with the following exceptions:
-Idir Search dir for included files whose names do not begin with a slash (/) prior to searching the usual directories. The
directories for multiple -I options are searched in the order specified. The preprocessor first searches for #include files
in the directory containing sourcefile, and then in directories named with -I options (if any), then /usr/ucbinclude, and
finally, in /usr/include.
-Ldir Add dir to the list of directories searched for libraries by /usr/ccs/bin/ucblint. This option is passed to
/usr/ccs/bin/ld. Directories specified with this option are searched before /usr/ucblib and /usr/lib.
-Y P, dir Change the default directory used for finding libraries.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
FILES
/usr/lint/bin/ld link editor
/usr/lib/libc C library
/usr/ucbinclude BSD Compatibility directory for header files
/usr/ucblib BSD Compatibility directory for libraries
/usr/ucblib/libucb BSD Compatibility C library
/usr/lib/libsocket library containing socket routines
/usr/lib/libnsl library containing network functions
/usr/lib/libelf library containing routines to process ELF object files
/usr/lib/libaio library containing asynchronous I/O routines
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO
ld(1), a.out(4), attributes(5)
SunOS 5.10 1 Feb 1995 lint(1B)