1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
Commit Graph

70 Commits

Author SHA1 Message Date
Chris Lattner
3259504cce Add a new gccld -native-cbe option which causes gccld to generate native code
for the application with the C backend instead of the native LLVM code generator

llvm-svn: 12698
2004-04-06 16:43:13 +00:00
Chris Lattner
3c9511b0ac Make sure to print a stack trace whenever an error signal is delivered to
the tool.

llvm-svn: 11633
2004-02-19 20:32:39 +00:00
John Criswell
90e72c9cba Added the -h option for compatibility with other linkers.
llvm-svn: 10335
2003-12-09 15:39:11 +00:00
Chris Lattner
21551f0cd4 Fix compatibility with gcc 3.4
llvm-svn: 10262
2003-11-29 19:45:47 +00:00
Misha Brukman
1af6ec9cbf I'm gonna be picky and say we don't really need that trailing slash "lib/"
llvm-svn: 10196
2003-11-24 05:31:57 +00:00
Misha Brukman
407528ec44 Make sure we ONLY add a `-load' switch to the JIT command line if the file is
verified as having an ELF header. This fixes PR151.

llvm-svn: 10195
2003-11-24 05:29:42 +00:00
Misha Brukman
c147a00407 When writing out the runner script, add -load=<lib> lines to pull in all the
shared objects automagically, so it doesn't have to be done by hand.

llvm-svn: 10114
2003-11-20 19:08:42 +00:00
Misha Brukman
f516afa0c0 * Doxygenified comments, simplifying them and shortening in the process
* Eliminated extra space

llvm-svn: 10104
2003-11-20 06:21:54 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
a38dea74cc Do not assume the first file is a bytecode file. Instead, construct a dummy
Module and link things into that.

Also, fix a typo in an error message.

llvm-svn: 9748
2003-11-05 22:13:00 +00:00
Chris Lattner
16a148787e Make -r work, fixing PR 91
llvm-svn: 9724
2003-11-05 06:05:21 +00:00
Chris Lattner
dc9da3878f If linking a library, do not link other libraries, like libc, into it!
This fixes lots of annoying warnings and error messages

llvm-svn: 9677
2003-11-03 17:27:17 +00:00
Brian Gaeke
93e3e06b90 lli -q is history. Rebuild your gccld shell scripts, folks!
llvm-svn: 9494
2003-10-24 20:00:06 +00:00
Chris Lattner
34a5a4c718 fix file header
llvm-svn: 9294
2003-10-20 17:58:43 +00:00
John Criswell
d06dc1136b Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Misha Brukman
6ff19a4909 * Ordered includes according to LLVM style
* Put function signatures on one line if possible
* Deleted empty comment lines (^//$)
* Deleted braces around single statements
* Deleted space between function call and argument list

llvm-svn: 8775
2003-09-30 17:59:25 +00:00
Brian Gaeke
7e16b3f05b 1. Use better error messages in LinkFiles().
2. I think the caller of LinkFiles() should not ignore a true return value.
   (If you have a good reason why it ought to, feel free to revert
   this. It's just something that's been bugging me for a while.)

llvm-svn: 8760
2003-09-30 14:03:48 +00:00
Chris Lattner
07621721bf Minor cleanups:
* Local header file goes at top
 * Remove unneeded #includes
 * Wrap code at 80 columns
 * Declare variables where they are used
 * 'register' is not needed
 * Use 'unsigned' instead of 'int' variables where possible

llvm-svn: 8657
2003-09-22 20:21:34 +00:00
John Criswell
a63a20d3eb Removed linking functionality from gccld.cpp and moved it to linker.cpp.
Renamed functions that were all lower-case.
Moved functions from util.cpp into linker.cpp or gccld.cpp.
Removed util.h and created gccld.h.
Refactored the linker functionality in linker.cpp so that it is easier to
follow, easier to modify, and it's library/object file search behavior is
easier to understand and document.
Added code to include library paths when doing native linking, but this
causes problems and is currently #ifdef'd out.

llvm-svn: 8609
2003-09-19 20:24:23 +00:00
John Criswell
9f7bb3c331 Refactored gccld into three C++ source files.
Added code ignore bytecode link failures when generating native code.
Moved native code and bytecode generation out of the main() function.

llvm-svn: 8595
2003-09-18 16:22:26 +00:00
John Criswell
d3b8e07a98 Replaced the call to strdup() with a new operator followed by a strcpy().
This should prevent calls to the new oerator and malloc.

llvm-svn: 8587
2003-09-17 19:14:41 +00:00
John Criswell
b0eb351d77 Added the use of the const keyword.
Have gccld find the path to llc and gcc instead of having the library do it.

llvm-svn: 8586
2003-09-17 19:04:22 +00:00
John Criswell
2682c34226 Removed the use of the environ variable and instead use the environment array
passed into main().  This may (or may not) be more portable, but it looks
nicer.
Added functions to copy the environment array and modify the copy, thus
preserving the environment.
Switched from using system() to using ExecWait().
The code now removes the assembly file generated when using the -native option.
Fixed the remove_env() function: The previous revision truncated the
environment variable list.  This version just zaps the variable as intended.

llvm-svn: 8579
2003-09-17 15:20:51 +00:00
John Criswell
206836748e Added the -native option.
With this option, gccld links the program into LLVM bytecode and a native code
binary.  This allows llvmgcc to correctly tell GNU configure scripts when
things aren't defined properly (because the native link will fail).

llvm-svn: 8570
2003-09-16 21:27:35 +00:00
Brian Gaeke
b10292fa2a -abort-on-exception is gone. Rebuild your gccld shell scripts, folks! :-)
llvm-svn: 8368
2003-09-05 19:23:03 +00:00
John Criswell
cdcee99ee6 Added code that makes the bytecode file readable (needed by the generated shell
script).
Removed the use of sys/types.h and sys/stat.h.
Modified FileExists() so that it uses the access() system call to check for
file existance.  This requires less header files and might even be a tad bit
faster.

llvm-svn: 8328
2003-09-02 21:11:22 +00:00
John Criswell
3ac81b74cb Modified the code so that it uses the MakeFileExecutable() method. The new
library code now adds all execute bits that are allowed by the umask value to
the file's current permission bits.

llvm-svn: 8325
2003-09-02 20:17:20 +00:00
John Criswell
9047331cc7 "Help keep our secrets secret."
Added code to respect the umask value.  Before, files were generated world
readable, which may not be desirable for all installations.

llvm-svn: 8215
2003-08-29 14:46:12 +00:00
Chris Lattner
2f00b4ed63 add preliminary support for -export-dynamic
llvm-svn: 8058
2003-08-22 19:18:45 +00:00
Misha Brukman
1b0f71e3f1 Make the bytecode file executable as well for LLEE purposes.
llvm-svn: 7992
2003-08-20 20:38:15 +00:00
Chris Lattner
899f2381f1 Revert my last (accidental) checkin, but keep the typeo fix
llvm-svn: 7879
2003-08-15 04:56:47 +00:00
Chris Lattner
0427dd4f4f rename selection library to selectiondag
llvm-svn: 7878
2003-08-15 04:56:09 +00:00
Chris Lattner
caa0d010d6 Run the simplify CFG pass after instcombine which has the effect of deleting
ALL of the global ctor/dtor stuff if it is not used!

llvm-svn: 6916
2003-06-26 05:29:50 +00:00
Chris Lattner
622df692df Move the instcombine pass before globaldce, so that if globals are made dead by instcombine, that they can be deleted.
llvm-svn: 6910
2003-06-26 04:32:31 +00:00
Chris Lattner
daebdb2358 Funcresolve no longer performs nicification of resolved functions
instcombine does this

llvm-svn: 6787
2003-06-19 17:03:51 +00:00
Chris Lattner
7b1df04748 Add new DAE pass to gccld. It does not add cause any regressions in the test-suite
llvm-svn: 6770
2003-06-18 16:29:02 +00:00
Chris Lattner
67b4289b39 Fix formatting in file
llvm-svn: 6398
2003-05-29 15:13:15 +00:00
Chris Lattner
c8e346caeb Add compatibility option
llvm-svn: 6354
2003-05-27 19:15:11 +00:00
Brian Gaeke
b599881570 gccld.cpp:
Fix typo in header.
 Add IsArchive static method.
 Roll LoadLibraryFromDirectory() into LoadLibrary(), and factor
  LoadLibraryExactName() out of the result. Instead of treating the current
  directory specially, just insert it into LibPaths in the beginning of
  main().
 Make LoadLibrary() take a "search" flag that says whether to search for the
  correct library, or just trust that LibName is right.
 Make LinkLibrary() take a "search" flag, and pass it to LoadLibrary().
 Change the for-loop over InputFilenames to detect ar archives and link them
  in as libraries without searching.
 Change the for-loop over Libraries to explicitly turn on the "search" flag
  to LinkLibrary() that makes LoadLibrary() search for the correct library
  (i.e., when processing -lNAME options.)

llvm-svn: 6316
2003-05-23 20:27:07 +00:00
Chris Lattner
a929e45913 Search LLVM_LIB_SEARCH_PATH for objects to allow it to find crtend.o
Implement minor library linking optimization.

llvm-svn: 6181
2003-05-13 22:14:13 +00:00
Chris Lattner
4a984c606f Make sure to create a target data that matches the Module's target properties.
llvm-svn: 5904
2003-04-24 19:13:02 +00:00
Chris Lattner
cfac8ce5da Add support for allowing the user to extend the GCCLD searchpath
llvm-svn: 5825
2003-04-21 19:53:24 +00:00
Chris Lattner
e3fca9bc04 Eliminate useless duplicate libraries
llvm-svn: 5823
2003-04-19 23:07:33 +00:00
Chris Lattner
8b99be746e Add first support for linking in .a files correctly and minimally, like a real linker does
llvm-svn: 5822
2003-04-19 22:44:38 +00:00
Chris Lattner
f53dee47b8 Add crufty compatibility stuff for ld
llvm-svn: 5813
2003-04-18 23:38:22 +00:00
Chris Lattner
60bb70a682 Use anonymous namespace instead of "static"
Kill using decl

llvm-svn: 5811
2003-04-18 23:01:25 +00:00
Chris Lattner
4fa3b88238 Allow the user to disable the internalize pass
llvm-svn: 5792
2003-04-16 21:43:22 +00:00
Chris Lattner
9a6368cb87 Make stuff compiled with gccld not dump into the debugger if there's a problem
llvm-svn: 5028
2002-12-14 21:28:32 +00:00
Chris Lattner
ea9f0c3c4e Print the tool name when an error comes from so that I can tell which
tool of a pipeline is having issues.

llvm-svn: 3167
2002-07-30 21:43:22 +00:00