Commit Graph

24 Commits

Author SHA1 Message Date
Jonas Maebe
04f7e47df7 * create stubs for library exports on Unix at at the node tree level instead
of using thlcg.g_external_wrapper() for high level targets, because that
    way the creation of a new procdef for this stub and adding appropriate
    entry/exit code can be handled using the standard compiler infrastructure
    (fixes webtbs/tw8730* for LLVM)

git-svn-id: trunk@35088 -
2016-12-09 13:39:38 +00:00
Jonas Maebe
472b5228fe * changed ncgutil.has_alias_name(pd,s) to a method of tprocdef
git-svn-id: trunk@35085 -
2016-12-09 13:39:28 +00:00
yury
649823a246 * Removed unused vars.
git-svn-id: trunk@34405 -
2016-09-01 20:01:54 +00:00
Jonas Maebe
c7ea921066 * renamed thlcgobj.g_external_wrapper() into a_jmp_external_name(), and
moved the code to create the procedure start/end etc. that was at the
    call sites of g_external_wrapper() into the new g_external_wrapper()
    -> got rid of the x86-specific code in expunix, and fixed expunix for
    llvm (e.g. tests/test/tlib1{a,b})

git-svn-id: trunk@34131 -
2016-07-14 15:26:40 +00:00
florian
4afb96a1cb * fix warning which prevents compilation with -Oodfa
git-svn-id: trunk@33521 -
2016-04-15 19:08:04 +00:00
svenbarth
3e70ac05c2 Merged revision(s) 32450-32451, 32455, 32457-32458, 32460-32462, 32477, 32480 from branches/svenbarth/packages:
cclasses.pas, TCmdStrList:
  * if doubles are not allowed then do case sensitive checks instead of insensitive ones

........
Correctly handle export/import generation depending on whether we're compiling for a system that needs indirect imports or not.

systems.pas:
  * replace systems_package_need_exports with systems_indirect_var_imports
pmodules.pas, proc_package:
  - remove check for systems_package_need_exports
pkgutil.pas:
  * insert_export, export_unit: export the direct or the indirect variable symbol depending on systems_indirect_var_imports

........
ncgrtti.pas, TRTTIWriter.write_extra_rttisyms:
  * enumdef_rtti_string2ordindex & enumdef_rtti_ord2stringindex: put the indirect suffix at the end of the symbol

........
pkgutil.pas, add_package_libs:
  * check for systems_indirect_var_imports instead of systems_package_needs_exports

........
expunix.pas, texportlibunix:
  * generatelib: check all procdefs whether they have the alias and not only the first one

........
pkgutil.pas:
  * insert_export: directly report the symbol type instead of its ordinal to ease finding of problems

........
pkgutil.pas, export_procsym:
  * restructure if for better readability
  + also check the procdef for po_has_public_name

........
Ensure that all implicitely imported units are indeed part of the package.

pmodules.pas, proc_package:
  * instead of checking the units loaded by the current module we need to check *all* units that are loaded for the package

........
Fix inclusion of PPUs that don't have a corresponding object file.

pkgutil.pas, RewritePPU:
  * don't abort if a unit does have the flag uf_no_link set
  * only abort if both uf_static_link and uf_no_link are not set

........
Generate an error if a unit listed as in "contains" is part of a directly or indirectly required package.

pmodules.pas, proc_package:
  * walk all units and check whether it had been loaded from a package, but is also part of the units of the current module; if so then generate an error

........

git-svn-id: trunk@33516 -
2016-04-15 14:23:55 +00:00
svenbarth
0aca2357ac Merged revision(s) 29037 from branches/svenbarth/packages:
Fix a potential access violation when exporting symbols on a Unix based system.

expunix.pas, texportlibunix:
  * generatelib: check whether hp2.sym is really assigned before accessing it

........

git-svn-id: trunk@32983 -
2016-01-22 17:02:40 +00:00
svenbarth
716b3082e9 Merged revision(s) 28792 from branches/svenbarth/packages:
Provide a possibility to ignore duplicate symbols for exporting.

export.pas, texportlib:
  + new property "ignoreduplicates" with which duplicate symbols are ignored upon insertion
  + new method "duplicatesymbol" which checks "ignoreduplicates" and generates an error if it is False (this method needs to be used if a duplicate was detected)
expunix.pas, texportlibunix:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_beos.pas, texportlibbeos:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_haiku.pas, texportlibhaiku:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwl.pas, texportlibnetwlibc:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwm.pas, texportlibnetware:
  * exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_win.pas, texportlibwin:
  * exportfromlist: use "duplicatesymbol" instead of always generating an error
........

git-svn-id: trunk@32974 -
2016-01-22 13:57:41 +00:00
svenbarth
3b71841a84 Merged revision(s) 28691, 31914 from branches/svenbarth/packages:
Convert export options from constants to a set and accordingly adjust all usage locations

git-svn-id: trunk@32945 -
2016-01-15 16:06:06 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
Jonas Maebe
b745dcc64c * moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
for some platforms it depends on that routine

git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
cf2ffdce1a * use cg.g_external_wrapper() rather than cg.a_jmp_name() to generate stubs
for alternate shared library function names (corrects them on at least
    AIX and Linux/ppc64)

git-svn-id: trunk@20816 -
2012-04-11 18:04:31 +00:00
Jonas Maebe
28740dce2d - removed extra "fordefinition" parameter again from tprocdef.mangledname(),
since the definition-specific adorning of JVM mangled names is Jasmin-
    specific, and such code has no place in symdef
  * moved code to adorn JVM mangled names for Jasmin definitions to agjasmin

git-svn-id: branches/jvmbackend@18346 -
2011-08-20 07:49:31 +00:00
Jonas Maebe
0ee702b3a2 * tprocdef.mangledname now gets an extra boolean parameter indicating
whether the mangled name is for defining a symbol, or for referencing
    it later (e.g. for a call or load of its address). The reason is that
    on the JVM both cases are different.
  + jvmdef unit to encode types according to the JVM rules
  + tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
    (the common part of defining/referencing it; tprocdef.mangledname
     afterwards adorns it as required)

git-svn-id: branches/jvmbackend@18288 -
2011-08-20 07:22:00 +00:00
Jonas Maebe
72e9cfee24 * create/destroy also the high level code generator for all architectures,
so it can be used in generic code

git-svn-id: branches/jvmbackend@18280 -
2011-08-20 07:21:16 +00:00
pierre
617e1b9b10 * handle i386/x86_64 solaris pic as for linux
git-svn-id: trunk@14388 -
2009-12-10 12:47:40 +00:00
Jonas Maebe
122e5714d8 * create/destroy codegen before/after generating exports, because it's
required when generating non-PIC code, and also for all Darwin platforms
    (required after r13801)

git-svn-id: trunk@14181 -
2009-11-15 11:19:09 +00:00
Jonas Maebe
6f3bace0f3 + support for exporting Objective-C classes from dynamic libraries. It works
the same as for exporting functions/procedures and variables: add the name
    of the class to the "exports" section of the library. By default, classes
    are only visible inside a shared library.

git-svn-id: branches/objc@13765 -
2009-09-27 15:40:52 +00:00
Jonas Maebe
7d459cf12a * the compiler now explicitly keeps track of the minimally guaranteed
alignment for each memory reference (mantis #12137, and
    test/packages/fcl-registry/tregistry1.pp on sparc). This also
    enables better code generation for packed records in many cases.
  o several changes were made to the compiler to minimise the chances
    of accidentally forgetting to set the alignment of memory references
    in the future:
    - reference_reset*() now has an extra alignment parameter
    - location_reset() can now only be used for non LOC_(C)REFERENCE,
      use location_reset_ref() for those (split the tloc enum so the
      compiler can catch errors using range checking)

git-svn-id: trunk@12719 -
2009-02-08 13:00:24 +00:00
florian
844c05ca2e * exports need pic on x86_64-freebsd
git-svn-id: trunk@11768 -
2008-09-13 15:46:33 +00:00
Jonas Maebe
4d4b7ddbf6 * renamed for consistency
git-svn-id: trunk@11289 -
2008-06-27 14:30:02 +00:00