Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com From: "Ralf Habacker" To: Subject: !AW: ld --auto-import for cygwin and libtool Date: Mon, 23 Jul 2001 22:27:25 +0200 Message-ID: <001001c113b5$e295c900$2c1406d5@BRAMSCHE> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <20010723143435.B888@redhat.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 > On Mon, Jul 23, 2001 at 01:09:25PM -0400, Charles Wilson wrote: > >Earnie Boyd wrote: > > > >> Christopher Faylor wrote: > >> > >>>It's possible that I might be convinced to include Paul's > patches in the > >>>next binutils release if they are not incorporated into the official > >>>release. However, I would rather use the official CVS release, if > >>>possible. > >>> > >>> > >> > >> Don't be too hastily convinced. I believe there to be problems of > >> exporting too much in lots of cases. > > > > > >Are we talking about Paul's --export-all-symbols/filtering changes, or > >his auto-imports changes (Currently, both changes are commingled in a > >single patch. I think.) > > Actually, I think that Paul submitted the --export-all-symbols patch to > binutils for approval, where it has languished for a while. > > He specifically did not include the auto-import stuff. I don't remember > if the auto-import patch also included export-all-symbols but I don't > believe that the converse is true. > In the binutils on which which Robert Collins has applied the auto-import patch, the --export-all-symbols switch is off. For compiling kde 1.1.2/kde 2 I have to set it, otherwise nothing will be exported. Relating to this switch I have found a problem on using static libs. The relating topic starts at http://sources.redhat.com/ml/cygwin/2001-07/msg01198.html For kde 2 I have written a dirty hack to avoid this (don't export any archive). This is no generic patch !! While thinking about how to solve this problem I recognized, that there have to be more ld switches to restrict exporting symbols. One proposal I think could be --export-whole-archive, which enables exporting all object files/archives beetwen it and --no-whole-archive or so. What are you thinking about this ? Ralf ---------------------------------------------------------------------------- ------------- pe-dll.c (line with ! are new) static int auto_export (abfd, d, n) bfd *abfd; def_file *d; const char *n; { int i; struct exclude_list_struct *ex; /* we should not re-export imported stuff */ if (strncmp (n, "_imp__",6) == 0) return 0; for (i = 0; i < d->num_exports; i++) if (strcmp (d->exports[i].name, n) == 0) return 0; if (pe_dll_do_default_excludes) { /* First of all, make context checks: Don't export anything from libgcc */ if (pe_dll_gory_debug) printf("considering exporting: %s " "abfd=%x, abfd->my_arc=%x filename=%s\n",n,abfd,abfd->my_archive,abfd-> filename); if (abfd && abfd->my_archive) { if (pe_dll_gory_debug) printf("considering exporting: %s " "abfd=%x, abfd->my_arc=%x filename=%s\n",n,abfd,abfd->my_archive,abfd-> my_archive->filename); ! /* don*'t export archives */ ! if (link_info.shared && strstr(abfd->my_archive->filename,".a")) { ! return 0; ! } /* Do not specify suffix explicitly, to allow for dllized versions */ if (strstr(abfd->my_archive->filename,"libgcc.")) return 0; if (strstr(abfd->my_archive->filename,"libstdc++.")) return 0; if (strstr(abfd->my_archive->filename,"libmingw32.")) return 0; } {