Browse Source

* Fix "-CX" use for i8086 with generic functions (test/tgenfuc*.pp tests),
it was currently broken as the specialization was declared
with local bind type, which generated no symbol at all
with the internal ogomf writer.

git-svn-id: trunk@34020 -

pierre 9 years ago
parent
commit
5ff51591cf
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/hlcgobj.pas

+ 6 - 1
compiler/hlcgobj.pas

@@ -4449,7 +4449,12 @@ implementation
              (target_info.system in systems_darwin) then
             list.concat(tai_directive.create(asd_reference,item.str));
           if (cs_profile in current_settings.moduleswitches) or
-            (po_global in current_procinfo.procdef.procoptions) then
+             { smart linking using a library requires to promote
+               all non-nested procedures to AB_GLOBAL
+               otherwise you get undefined symbol error at linking
+               for msdos  target with -CX option for instance }
+             (create_smartlink_library and not is_nested_pd(current_procinfo.procdef)) or
+             (po_global in current_procinfo.procdef.procoptions) then
             list.concat(Tai_symbol.createname_global(item.str,AT_FUNCTION,0))
           else
             list.concat(Tai_symbol.createname(item.str,AT_FUNCTION,0));