public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108462] New: duplicate install of static libraries
@ 2023-01-19 10:41 rguenth at gcc dot gnu.org
  2023-01-19 14:26 ` [Bug modula2/108462] " gaius at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-19 10:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

            Bug ID: 108462
           Summary: duplicate install of static libraries
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

rguenther@ryzen:/tmp/obj> find ../install -name libm2cor.la                    
../install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/libm2cor.la
../install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/m2/m2cor/libm2cor.la
../install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32/m2/m2cor/libm2cor.la
rguenther@ryzen:/tmp/obj> find ../install -name libm2cor.a 
../install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/libm2cor.a
../install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/m2/m2cor/libm2cor.a
../install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32/m2/m2cor/libm2cor.a

both in ../13.0.1/ and ../13.0.1/m2/m2cor/ along .mod/.def files?

They are installed via

toolexeclib_LTLIBRARIES = libm2cor.la

but in addition to that via

install-data-local: force
        mkdir -p $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
        $(INSTALL_DATA) .libs/libm2cor.la
$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
        chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2cor.la
        $(INSTALL_DATA) .libs/libm2cor.a
$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
        chmod 644 $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2cor.a
        $(RANLIB) $(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)libm2cor.a

why's that done?  How could I check whether they are necessary or not?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
@ 2023-01-19 14:26 ` gaius at gcc dot gnu.org
  2023-01-19 15:01 ` gaius at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-19 14:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

Gaius Mulley <gaius at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gaius at gcc dot gnu.org

--- Comment #1 from Gaius Mulley <gaius at gcc dot gnu.org> ---
Created attachment 54309
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54309&action=edit
script to run coroutine test cases

To check whether they are necessary it should be possible to run the coroutine
test cases.  It will need adapting as the gcc-read-write and build are hard
coded.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
  2023-01-19 14:26 ` [Bug modula2/108462] " gaius at gcc dot gnu.org
@ 2023-01-19 15:01 ` gaius at gcc dot gnu.org
  2023-01-20 14:55 ` gaius at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-19 15:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> ---
There should be archives in the different architecture directories as per
normal.  Accompanying these should be the library module source SYSTEM.def
(which could vary depending upon architectural characteristics).
The remaining sources are copies from the source tree.
It certainly looks as if the source files in ../13.0.1 are unnecessary given
the driver search path uses:

   -I ... 13.0.1/m2/m2pim    -L ... 13.0.1/m2/m2pim

I think the static archives and sources in 13.0.1 could be removed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
  2023-01-19 14:26 ` [Bug modula2/108462] " gaius at gcc dot gnu.org
  2023-01-19 15:01 ` gaius at gcc dot gnu.org
@ 2023-01-20 14:55 ` gaius at gcc dot gnu.org
  2023-01-23  9:47 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gaius at gcc dot gnu.org @ 2023-01-20 14:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

--- Comment #3 from Gaius Mulley <gaius at gcc dot gnu.org> ---
ah, oops, of course the testsuite checks in tree :-)

So after an install:

$ cd gcc/testsuite/gm2/isocoroutines/run/pass
$ gm2 -fiso coroutine.mod && ./a.out

would be a simple test.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-20 14:55 ` gaius at gcc dot gnu.org
@ 2023-01-23  9:47 ` rguenth at gcc dot gnu.org
  2023-01-23 10:08 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-23  9:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so besides the relocation issue it seems that search paths (or install
paths) are wrong (because of my changes?).  Configuring with
--prefix=/tmp/install and doing

> /tmp/install/bin/gm2 -fiso coroutine.mod   
<built-in>: error: the file containing the definition module 'SYSTEM' cannot be
found

because adding -v reveals

 /tmp/install/lib/gcc/x86_64-pc-linux-gnu/13.0.1/cc1gm2
-iplugindir=/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/plugin -quiet
-dumpdir a- -dumpbase coroutine.mod -dumpbase-ext .mod -mtune=generic
-march=x86-64 -version -fiso -fgen-module-list=- -fplugin=m2rte -fiso
-fgen-module-list=- -fplugin=m2rte -I
/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/m2/m2iso -I
/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/m2/m2pim -v coroutine.mod -o
/tmp/ccwuuAId.s

but

> find install -iname system.mod
install/lib64/m2/m2pim/SYSTEM.mod
install/lib64/m2/m2iso/SYSTEM.mod
install/lib64/m2/m2cor/SYSTEM.mod
install/lib64/m2/m2min/SYSTEM.mod
install/lib/m2/m2pim/SYSTEM.mod
install/lib/m2/m2iso/SYSTEM.mod
install/lib/m2/m2cor/SYSTEM.mod
install/lib/m2/m2min/SYSTEM.mod

so the frontend/driver expect the m2/m2{pim,iso,cor,min} dirs to be in
a version specific directory.

libgfortran for example uses

cafexeclib_LTLIBRARIES = libcaf_single.la
cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)

my r13-5284-ge61d43791e0943 changed

-       $(INSTALL_DATA) .libs/libm2iso.a
$(DESTDIR)$(inst_libdir)/$(MULTIDIR)$(M2LIBDIR)
+       $(INSTALL_DATA) .libs/libm2iso.la
$(DESTDIR)$(toolexeclibdir)$(M2LIBDIR)

fighting a duplicate MULTIDIR, maybe I should have just removed $(MULTIDIR)
here, inst_libdir is

libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
inst_libdir = $(libsubdir)$(MULTISUBDIR)

which looks possibly correct.  I'm going to test that.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-01-23  9:47 ` rguenth at gcc dot gnu.org
@ 2023-01-23 10:08 ` rguenth at gcc dot gnu.org
  2023-01-31 14:55 ` cvs-commit at gcc dot gnu.org
  2023-01-31 14:56 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-23 10:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so after fixing that I see

 /tmp/install/lib/gcc/x86_64-pc-linux-gnu/13.0.1/collect2 -plugin
/tmp/install/lib/gcc/x86_64-pc-linux-gnu/13.0.1/liblto_plugin.so
-plugin-opt=/tmp/install/lib/gcc/x86_64-pc-linux-gnu/13.0.1/lto-wrapper
-plugin-opt=-fresolution=/tmp/cchKWOsJ.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc -m elf_i386
-static /usr/lib/../lib/crt1.o /usr/lib/../lib/crti.o
/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32/crtbeginT.o
-L/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32/m2/m2iso
-L/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32/m2/m2pim
-L/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32
-L/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/../../../../lib
-L/lib/../lib -L/usr/lib/../lib
-L/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1
-L/tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/../../.. /tmp/cc2HjFtG.o
-lm2iso -lm2pim -lstdc++ -lm -lpthread --start-group -lgcc -lgcc_eh -lc
--end-group /tmp/install/lib64/gcc/x86_64-pc-linux-gnu/13.0.1/32/crtend.o
/usr/lib/../lib/crtn.o

that means we search both install locations so we could drop either copy.
Dropping the static lib in the m2/m2*/ directories would allow to prune
the library search path as far as I understand (and the shared libs are
in different paths anyway, with --enable-version-specific-runtime-libs
they are in the place of the other static lib copy).

The advantage of keeping the m2/m2*/ copy is that for the regular install
the static libs would not clobber the main install location but then

toolexeclib_LTLIBRARIES = libm2cor.la

doesn't really support having two different locations for the static/shared
lib parts.

I'm going to first fix the mistake done by r13-5284-ge61d43791e0943

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-23 10:08 ` rguenth at gcc dot gnu.org
@ 2023-01-31 14:55 ` cvs-commit at gcc dot gnu.org
  2023-01-31 14:56 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-31 14:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:7f583a335769591d016caa51490e3e5dd50354fe

commit r13-5576-g7f583a335769591d016caa51490e3e5dd50354fe
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jan 23 11:43:53 2023 +0100

    modula2/108462 - duplicate install of static modula2 target libs

    The following addresses the fact that libgm2 installs static libraries
    into two places, one performed by

    toolexeclib_LTLIBRARIES = libm2cor.la

    and one performed as part of the install-data-local rule to a
    m2/m2cor subdirectory alongside Modula-2 .def and .mod files.

    This patch opts to keep the copy installed by libtool and removes
    the extra installs in the install-data-local rules.

    I've built and installed both with and without
    --enable-version-specific-runtime-libs and compiled and linked
    a Modula-2 testcase with the installed compiler with the two
    multilibs and with and without static successfully.

            PR modula2/108462
    libgm2/
            * libm2cor/Makefile.am: Remove static lib install from
            install-data-local.
            * libm2iso/Makefile.am: Likewise.
            * libm2log/Makefile.am: Likewise.
            * libm2min/Makefile.am: Likewise.
            * libm2pim/Makefile.am: Likewise.
            * libm2cor/Makefile.in: Regenerate.
            * libm2iso/Makefile.in: Likewise.
            * libm2log/Makefile.in: Likewise.
            * libm2min/Makefile.in: Likewise.
            * libm2pim/Makefile.in: Likewise.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug modula2/108462] duplicate install of static libraries
  2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-31 14:55 ` cvs-commit at gcc dot gnu.org
@ 2023-01-31 14:56 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-31 14:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108462

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-01-31 14:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 10:41 [Bug modula2/108462] New: duplicate install of static libraries rguenth at gcc dot gnu.org
2023-01-19 14:26 ` [Bug modula2/108462] " gaius at gcc dot gnu.org
2023-01-19 15:01 ` gaius at gcc dot gnu.org
2023-01-20 14:55 ` gaius at gcc dot gnu.org
2023-01-23  9:47 ` rguenth at gcc dot gnu.org
2023-01-23 10:08 ` rguenth at gcc dot gnu.org
2023-01-31 14:55 ` cvs-commit at gcc dot gnu.org
2023-01-31 14:56 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).