Commit Graph

192 Commits

Author SHA1 Message Date
Chris Lattner 05fe0244e1 Even with -disable-opt we should still internalize and strip if requested.
llvm-svn: 17903
2004-11-16 18:59:20 +00:00
Reid Spencer 16c3bb3198 Linker.h has a new home.
llvm-svn: 17801
2004-11-14 23:00:08 +00:00
Reid Spencer 23dcddf47f This tool needs the libLLVMArchive library now.
llvm-svn: 17789
2004-11-14 22:19:21 +00:00
Reid Spencer 5f7d9675d4 Remove linking declarations (in Linker.h now)
llvm-svn: 17788
2004-11-14 22:17:49 +00:00
Reid Spencer 5ccfd9aea1 Provide exception handling
llvm-svn: 17787
2004-11-14 22:17:03 +00:00
Reid Spencer 3afabd441b Moved to lib/Linker
llvm-svn: 17786
2004-11-14 22:15:31 +00:00
Misha Brukman 8d5c13c3e3 Output the program name (in this case, gccld) with warning about invalid files
llvm-svn: 17638
2004-11-09 04:24:59 +00:00
Misha Brukman 465e7fb8ef Don't silently ignore invalid files: tell the user!
llvm-svn: 17633
2004-11-08 22:03:10 +00:00
Reid Spencer 57cbe39d1e Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer 5fd95ce095 We're not doing automake any more
llvm-svn: 17168
2004-10-22 21:02:23 +00:00
Reid Spencer c1c320c335 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer 6a11a75f31 Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Reid Spencer ace94df71f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Chris Lattner 155cfd237b Don't miss global optimizations because we run before the inliner
llvm-svn: 16913
2004-10-11 04:47:18 +00:00
Reid Spencer f6d9ceebc6 Initial version of automake Makefile.am file.
llvm-svn: 16894
2004-10-10 22:36:40 +00:00
Chris Lattner fa3cfd3955 Rename pass
llvm-svn: 16801
2004-10-07 04:12:02 +00:00
Reid Spencer 7c16caa336 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer 74c3dc6927 Add the LLVMsystem.a library as it is now used for operating system
independence of the tool.

llvm-svn: 16092
2004-08-29 19:29:38 +00:00
Reid Spencer e3263ecaf0 The functions in Signal.h are now in the llvm::sys namespace - adjust
llvm-svn: 16091
2004-08-29 19:28:55 +00:00
Chris Lattner ac44389c83 This pass has proven its metal, remove -disable option.
llvm-svn: 15411
2004-08-02 10:10:08 +00:00
Chris Lattner aa5b25eae6 Run DSE at link-time, and turn on an IP alias analysis by default in gccld!
The -disable-globalsmodref is temporary and will be removed eventually.

llvm-svn: 15268
2004-07-27 08:13:15 +00:00
Misha Brukman 28ee8f0f30 Linker.h moved to include/llvm/Support
llvm-svn: 14351
2004-06-23 17:33:09 +00:00
Chris Lattner 6662d33f8a Make gccld copy the llvm-stub program to be the execution wrapper for
bytecode files on win32 systems.  We keep the shell script on unix systems
because it is much more transparent for the users and supports -load
options.

This allows llvmgcc work correctly on win32 systems without the -native or
-native-cbe options.

llvm-svn: 13946
2004-06-02 00:53:57 +00:00
Chris Lattner 85b943dd06 Move some functions out of gccld.cpp to GenerateCode.cpp. This allows us
to reduce the inter-file interface in the gccld tool and gets some
uninteresting code out of gccld.cpp.

llvm-svn: 13942
2004-06-02 00:22:24 +00:00
Chris Lattner fdcb868fef Refactor a bit of code into a function, no functionality changes.
llvm-svn: 13941
2004-06-02 00:10:19 +00:00
Chris Lattner 278f5152d3 Header file moved
llvm-svn: 13813
2004-05-27 05:41:36 +00:00
Brian Gaeke 9a7b9d07f0 Allow the user to set the LLVMINTERP environment variable as a workaround, for
when they have to run a gccld shell script without having lli in their path.
This is intended to address Bug 289.

Also, emit the traditional syntax ${1+"$@"} for passing all of a shell script's
args to a subprocess. If you have arguments that have spaces in them, $* will
not preserve the quoting (i.e., the quoted string "foo bar" as an argument will
end up as two arguments "foo" "bar" to lli.)

llvm-svn: 13414
2004-05-07 21:47:36 +00:00
Misha Brukman d061d81571 Don't use invalid HTML in a doxygen comment.
llvm-svn: 12962
2004-04-15 15:23:45 +00:00
Chris Lattner a2b279e89c Add a couple more IPO's
llvm-svn: 12863
2004-04-12 05:38:15 +00:00
Chris Lattner d61b13c6e2 Disable strict alias analysis in the backend c compiler, as the code we
generate is not TBAA safe.

llvm-svn: 12774
2004-04-08 15:18:59 +00:00
Chris Lattner a182f5bf48 Revert previous patch, I'm a moron :)
llvm-svn: 12773
2004-04-08 15:18:03 +00:00
Chris Lattner 177fe8d82f Right, we break strict aliasing requirements. Make sure to disable strict
aliasing in the C compiler.

llvm-svn: 12772
2004-04-08 15:14:43 +00:00
Chris Lattner e216fc01b7 Minor cleanups
llvm-svn: 12700
2004-04-06 16:54:04 +00:00
Chris Lattner ad733e733e 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 ac2e2d3bdd Run the new pass in gccld now that it passes all tests
llvm-svn: 12196
2004-03-07 22:12:40 +00:00
Chris Lattner 73687be9d7 We have this snazzy link-time optimizer. How about we start using it? This
removes some cruft from 255.vortex, cleaning up after DAE and IPCP, which
do horrible, beautiful, things to vortex.

llvm-svn: 11861
2004-02-26 03:34:30 +00:00
Chris Lattner b66a35ef9c Add a new pass, run internalize first
llvm-svn: 11839
2004-02-25 21:35:13 +00:00
Alkis Evlogimenos d140e3d4ff Include Config/config.h for SHLIBEXT.
llvm-svn: 11779
2004-02-23 22:42:51 +00:00
Chris Lattner 69e896bdcf 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 36eebb51f2 Fixed PR#197. The libcrtend library is removed from the library linking list
when creating native executables.

llvm-svn: 10979
2004-01-26 23:51:10 +00:00
John Criswell e6a41815f3 Fixes for PR214. Use the SHLIBEXT variable instead of hardcoding .so into
every file.

llvm-svn: 10976
2004-01-26 20:59:41 +00:00
Chris Lattner 298d2f090f Make sure to verify the result before writing out the bytecode file. Not doing
so can cause obscure errors downstream.

llvm-svn: 10840
2004-01-14 03:39:46 +00:00
John Criswell 80ce0e620e Modified the logic so that library objects with main() are only linked in
if the program currently has main undefined.

llvm-svn: 10597
2003-12-23 20:27:14 +00:00
John Criswell b6d3cb9449 Modified the linker so that it always links in an object from an archive
that defines the symbol "main."  This is a hack that ensures that programs
that place their main function in a library and then link it in
(i.e. Apache 2.x) get their main function linked in.

There is probably a more correct way to do this, but this works for now.

llvm-svn: 10594
2003-12-23 17:37:06 +00:00
John Criswell 7dd715180d Added the -h option for compatibility with other linkers.
llvm-svn: 10335
2003-12-09 15:39:11 +00:00
Chris Lattner 982b285232 Fix compatibility with gcc 3.4
llvm-svn: 10262
2003-11-29 19:45:47 +00:00
Chris Lattner 8abd7dca76 The function resolving pass must be run, even if -disable-opt is specified
llvm-svn: 10250
2003-11-28 09:44:03 +00:00
Chris Lattner fcaa6fbbd8 * The return value of LinkLibraries is ignored, so remove it.
* Finegrainify namespacification of Linker.cpp
* If linking a library in fails, do not STOP LINKING IN LIBRARIES AND
  CONTINUE ANYWAY!  Instead, just output the warning, and keep going. :)

llvm-svn: 10249
2003-11-28 07:44:09 +00:00
Misha Brukman c10bf39a7d 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 44a562bba6 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 1df12628a0 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 c0e6157f99 Add ability to search only for native shared object, and expose the
functionality to the rest of gccld.

llvm-svn: 10113
2003-11-20 19:08:06 +00:00
Misha Brukman aa525937c7 For consistency, removed space between function name and left paren in function
call, i.e. [ addPass (...) ]  =>  [ addPass(...) ]

llvm-svn: 10105
2003-11-20 06:26:15 +00:00
Misha Brukman d16a03727b * 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 eb3de8f39a Add a -verify option to verify the results of gccld passes.
Add a -disable-opt option to turn off gccld optimization passes.

llvm-svn: 10040
2003-11-16 23:07:28 +00:00
Brian Gaeke 7ff0d09adc When we find a module we want, in an archive, in verbose mode,
print out the module's identifier (which should now contain the name
 of both the archive and the module.)
Wrap some lines at 80 cols.

llvm-svn: 10039
2003-11-16 23:07:13 +00:00
Brian Gaeke 960707c335 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 da3f675edd Move IsArchive, IsBytecode to FileUtilities. Fix up some method comments.
llvm-svn: 9902
2003-11-11 21:54:01 +00:00
Brian Gaeke ec21f8e9bf This version of Linker.cpp works a lot better, but it's a little messy. Sorry.
Use FileOpenable() instead of FileExists().
Create IsBytecode() predicate -- like IsArchive(), but for bytecode files.
Use IsBytecode() before trying to load any file as a bytecode file.

llvm-svn: 9893
2003-11-11 18:27:37 +00:00
Chris Lattner b2d575769b Give gccld more guts
llvm-svn: 9835
2003-11-09 19:55:09 +00:00
Brian Gaeke 6f54518e08 Give this header file an Emacs mode-line.
llvm-svn: 9749
2003-11-05 22:13:10 +00:00
Brian Gaeke 1d9515b0a1 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
Brian Gaeke 31af708ef6 Shorten and correct some function-header comments.
Make "verbose" output MUCH nicer. Now it tells you when you are linking a
bytecode file, or an archive, and whether it's because you called it by name,
or because you gave it a -l option, and it says "Trying" before it takes
action and prints a message in the past tense afterwards.

Make LinkFiles not skip the first file in Files.

Make LinkFiles warn you if it can't find a file and LLVM_LIB_SEARCH_PATH is
unset.

llvm-svn: 9747
2003-11-05 22:12:52 +00:00
Chris Lattner c17fe1cdfe Make -r work, fixing PR 91
llvm-svn: 9724
2003-11-05 06:05:21 +00:00
Chris Lattner cbf2aeb684 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 275811125d lli -q is history. Rebuild your gccld shell scripts, folks!
llvm-svn: 9494
2003-10-24 20:00:06 +00:00
Chris Lattner b1e8187c31 Turn on the inliner by default at link-time
llvm-svn: 9477
2003-10-24 18:09:23 +00:00
Chris Lattner 95ee0b0288 Turn on the IPCP pass by default. It has passed all of the tests
llvm-svn: 9435
2003-10-23 18:25:57 +00:00
Brian Gaeke 9e10b9a96f Fix off-by-one error in processing of libraries named on command line.
llvm-svn: 9351
2003-10-21 21:07:12 +00:00
John Criswell abe5cdcf21 Added LLVM copyright to Makefiles.
llvm-svn: 9314
2003-10-20 22:29:16 +00:00
Chris Lattner 8f71f04961 fix file header
llvm-svn: 9294
2003-10-20 17:58:43 +00:00
John Criswell 09344dcf97 Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Brian Gaeke 2797c131ef Don't include "Config/stdlib.h".
llvm-svn: 9037
2003-10-10 19:12:22 +00:00
Misha Brukman 8b2bd4ed47 Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Brian Gaeke 068546cf78 Make more error messages have gccld's name in them.
Add a newline after "Cannot find <library>".

llvm-svn: 8968
2003-10-08 19:09:30 +00:00
Misha Brukman e4edb3f3db Doxygen-ified comments.
llvm-svn: 8778
2003-09-30 18:09:32 +00:00
Misha Brukman 21663634c5 * 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
Misha Brukman 143af9cf13 Made code more terse:
* Deleted empty comment lines
* No single begin-braces '{' on a line by themselves

llvm-svn: 8773
2003-09-30 17:51:20 +00:00
Misha Brukman 33b9647a45 Doxygen-ified function comments.
llvm-svn: 8771
2003-09-30 17:42:57 +00:00
Misha Brukman af3b3bdf6d Removed extra space in comments.
llvm-svn: 8770
2003-09-30 17:40:12 +00:00
Chris Lattner f5f4cbb055 Remove initials from source file
llvm-svn: 8769
2003-09-30 17:36:51 +00:00
Misha Brukman a307080d60 Make code more terse:
* Remove extra blank lines
* Delete space between function call and arg list
* Delete non-content comment lines ("//")

llvm-svn: 8768
2003-09-30 17:33:12 +00:00
Brian Gaeke 484f2c7442 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 cc83d5f3e2 Update file headers for renamed files.
llvm-svn: 8758
2003-09-30 03:24:28 +00:00
Misha Brukman b3541d4264 Tersified code:
* Removed space between function name and its argument list
* Removed space between '&' and variable name
* Removed empty comment lines: `//'

llvm-svn: 8750
2003-09-29 22:26:24 +00:00
Misha Brukman 0575c6c432 * Ordered includes according to LLVM programmers' guide
* Made code layout more verbose: no more '{' on a line by itself
* Pruned extra whitespace

llvm-svn: 8748
2003-09-29 22:16:43 +00:00
Chris Lattner 65d93e208b 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 17c3d4dfc1 New header file for gccld.
llvm-svn: 8610
2003-09-19 20:24:40 +00:00
John Criswell b533bde540 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 8ecc30249f 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 a2748c267b 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 0217b1beb3 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 f22d845bd7 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 1997a34e26 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 28f8e41203 -abort-on-exception is gone. Rebuild your gccld shell scripts, folks! :-)
llvm-svn: 8368
2003-09-05 19:23:03 +00:00
John Criswell a3ce8b48b0 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 06327da723 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 c907487c22 "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 b4d9921728 add preliminary support for -export-dynamic
llvm-svn: 8058
2003-08-22 19:18:45 +00:00
Misha Brukman 90869942e7 Make the bytecode file executable as well for LLEE purposes.
llvm-svn: 7992
2003-08-20 20:38:15 +00:00