#2175 WSL: libmingwex.a lacks llround, llroundf, and llroundl functions

WSL
pending
regression (8)
Bug
fixed
IINR_-_Include_In_Next_Release
False
2015-01-08
2014-01-22
No

As noted in follow up of ticket [#2155], these three functions, all of which should be derived from the lround_generic.c source, are missing from the WSL build of libmingwex.a, whereas they were included in the mingwrt-3.x builds.

Related

Issues: #2155

Discussion

  • Keith Marshall

    Keith Marshall - 2014-01-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1 @@
    -As noted in follow up of ticket [#2155], three functions, all of which should be derived from the lround_generic.c source, are missing from the WSL build of libmingwex.a, whereas they were included in the mingwrt-3.x builds.
    +As noted in follow up of ticket [#2155], these three functions, all of which should be derived from the lround_generic.c source, are missing from the WSL build of libmingwex.a, whereas they were included in the mingwrt-3.x builds.
    
     
  • Thorsten Otto

    Thorsten Otto - 2014-01-23

    Patch added.

     
  • Keith Marshall

    Keith Marshall - 2014-01-23

    Patch added.

    Thanks, but I'm not going to accept any patch which proliferates redundant source file stubs, such as asinh[fl].c, llround.c, and llround[fl].c; rather, I want to get rid of the few such redundancies which already exist, such as round[fl].c, and lround[fl].c, (and even the stubs currently provided for round.c, and lround.c, which may be conveniently replaced by renaming round_generic.c, and lround_generic.c, respectively).

    The crux of this issue is that, when you run make, the wrong pattern rules seem to be selected for targets such as src/libcrt/math/fabs[fl].o, or src/libcrt/math/asinh[fl].o, whereas, when I run it, the correct rules are selected:

    $ make -n -d src/libcrt/math/fabsf.o
    GNU Make 3.81
    Copyright (C) 2006  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    
    This program built for x86_64-pc-linux-gnu
    . . .
    
    Updating goal targets....
    Considering target file `src/libcrt/math/fabsf.o'.
     Looking for an implicit rule for `src/libcrt/math/fabsf.o'.
     Trying pattern rule with stem `fabsf'.
     Trying implicit prerequisite `src/libcrt/math/fabsf.c'.
     Found prerequisite `src/libcrt/math/fabsf.c' as VPATH `../src/libcrt/math/fabsf.c'
     Found an implicit rule for `src/libcrt/math/fabsf.o'.
      Considering target file `src/libcrt/math/fabsf.c'.
       Looking for an implicit rule for `src/libcrt/math/fabsf.c'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.y'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.l'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.w'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.w'.
       Trying pattern rule with stem `fabsf.c'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.c,v'.
       Trying pattern rule with stem `fabsf.c'.
       Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.c,v'.
       Trying pattern rule with stem `fabsf.c'.
       Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.c'.
       Trying pattern rule with stem `fabsf.c'.
       Trying implicit prerequisite `src/libcrt/math/s.fabsf.c'.
       Trying pattern rule with stem `fabsf.c'.
       Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabsf.c'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.y'.
       Looking for a rule with intermediate file `src/libcrt/math/fabsf.y'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `fabsf.y'.
        Trying implicit prerequisite `src/libcrt/math/fabsf.y,v'.
        Trying pattern rule with stem `fabsf.y'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.y,v'.
        Trying pattern rule with stem `fabsf.y'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.y'.
        Trying pattern rule with stem `fabsf.y'.
        Trying implicit prerequisite `src/libcrt/math/s.fabsf.y'.
        Trying pattern rule with stem `fabsf.y'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabsf.y'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.l'.
       Looking for a rule with intermediate file `src/libcrt/math/fabsf.l'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `fabsf.l'.
        Trying implicit prerequisite `src/libcrt/math/fabsf.l,v'.
        Trying pattern rule with stem `fabsf.l'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.l,v'.
        Trying pattern rule with stem `fabsf.l'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.l'.
        Trying pattern rule with stem `fabsf.l'.
        Trying implicit prerequisite `src/libcrt/math/s.fabsf.l'.
        Trying pattern rule with stem `fabsf.l'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabsf.l'.
       Trying pattern rule with stem `fabsf'.
       Trying implicit prerequisite `src/libcrt/math/fabsf.w'.
       Looking for a rule with intermediate file `src/libcrt/math/fabsf.w'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `fabsf.w'.
        Trying implicit prerequisite `src/libcrt/math/fabsf.w,v'.
        Trying pattern rule with stem `fabsf.w'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.w,v'.
        Trying pattern rule with stem `fabsf.w'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabsf.w'.
        Trying pattern rule with stem `fabsf.w'.
        Trying implicit prerequisite `src/libcrt/math/s.fabsf.w'.
        Trying pattern rule with stem `fabsf.w'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabsf.w'.
       Trying pattern rule with stem `fabsf'.
       Rejecting impossible implicit prerequisite `src/libcrt/math/fabsf.w'.
       No implicit rule found for `src/libcrt/math/fabsf.c'.
       Finished prerequisites of target file `src/libcrt/math/fabsf.c'.
      No need to remake target `src/libcrt/math/fabsf.c'; using VPATH name `../src/libcrt/math/fabsf.c'.
     Finished prerequisites of target file `src/libcrt/math/fabsf.o'.
     Prerequisite `../src/libcrt/math/fabsf.c' is older than target `src/libcrt/math/fabsf.o'.
    No need to remake target `src/libcrt/math/fabsf.o'.
    make: `src/libcrt/math/fabsf.o' is up to date.
    
    $ make -n -d src/libcrt/math/asinhf.o
    . . .
    
    Updating goal targets....
    Considering target file `src/libcrt/math/asinhf.o'.
     Looking for an implicit rule for `src/libcrt/math/asinhf.o'.
     Trying pattern rule with stem `asinhf'.
     Trying implicit prerequisite `src/libcrt/math/asinhf.c'.
     Trying pattern rule with stem `asinhf'.
     Trying implicit prerequisite `src/libcrt/math/asinhf.s'.
     Trying pattern rule with stem `asinh'.
     Trying implicit prerequisite `src/libcrt/math/asinh.c'.
     Found prerequisite `src/libcrt/math/asinh.c' as VPATH `../src/libcrt/math/asinh.c'
     Found an implicit rule for `src/libcrt/math/asinhf.o'.
      Considering target file `src/libcrt/math/asinh.c'.
       Looking for an implicit rule for `src/libcrt/math/asinh.c'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.y'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.l'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.w'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.w'.
       Trying pattern rule with stem `asinh.c'.
       Trying implicit prerequisite `src/libcrt/math/asinh.c,v'.
       Trying pattern rule with stem `asinh.c'.
       Trying implicit prerequisite `src/libcrt/math/RCS/asinh.c,v'.
       Trying pattern rule with stem `asinh.c'.
       Trying implicit prerequisite `src/libcrt/math/RCS/asinh.c'.
       Trying pattern rule with stem `asinh.c'.
       Trying implicit prerequisite `src/libcrt/math/s.asinh.c'.
       Trying pattern rule with stem `asinh.c'.
       Trying implicit prerequisite `src/libcrt/math/SCCS/s.asinh.c'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.y'.
       Looking for a rule with intermediate file `src/libcrt/math/asinh.y'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `asinh.y'.
        Trying implicit prerequisite `src/libcrt/math/asinh.y,v'.
        Trying pattern rule with stem `asinh.y'.
        Trying implicit prerequisite `src/libcrt/math/RCS/asinh.y,v'.
        Trying pattern rule with stem `asinh.y'.
        Trying implicit prerequisite `src/libcrt/math/RCS/asinh.y'.
        Trying pattern rule with stem `asinh.y'.
        Trying implicit prerequisite `src/libcrt/math/s.asinh.y'.
        Trying pattern rule with stem `asinh.y'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.asinh.y'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.l'.
       Looking for a rule with intermediate file `src/libcrt/math/asinh.l'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `asinh.l'.
        Trying implicit prerequisite `src/libcrt/math/asinh.l,v'.
        Trying pattern rule with stem `asinh.l'.
        Trying implicit prerequisite `src/libcrt/math/RCS/asinh.l,v'.
        Trying pattern rule with stem `asinh.l'.
        Trying implicit prerequisite `src/libcrt/math/RCS/asinh.l'.
        Trying pattern rule with stem `asinh.l'.
        Trying implicit prerequisite `src/libcrt/math/s.asinh.l'.
        Trying pattern rule with stem `asinh.l'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.asinh.l'.
       Trying pattern rule with stem `asinh'.
       Trying implicit prerequisite `src/libcrt/math/asinh.w'.
       Looking for a rule with intermediate file `src/libcrt/math/asinh.w'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `asinh.w'.
        Trying implicit prerequisite `src/libcrt/math/asinh.w,v'.
        Trying pattern rule with stem `asinh.w'.
        Trying implicit prerequisite `src/libcrt/math/RCS/asinh.w,v'.
        Trying pattern rule with stem `asinh.w'.
        Trying implicit prerequisite `src/libcrt/math/RCS/asinh.w'.
        Trying pattern rule with stem `asinh.w'.
        Trying implicit prerequisite `src/libcrt/math/s.asinh.w'.
        Trying pattern rule with stem `asinh.w'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.asinh.w'.
       Trying pattern rule with stem `asinh'.
       Rejecting impossible implicit prerequisite `src/libcrt/math/asinh.w'.
       No implicit rule found for `src/libcrt/math/asinh.c'.
       Finished prerequisites of target file `src/libcrt/math/asinh.c'.
      No need to remake target `src/libcrt/math/asinh.c'; using VPATH name `../src/libcrt/math/asinh.c'.
     Finished prerequisites of target file `src/libcrt/math/asinhf.o'.
     Prerequisite `../src/libcrt/math/asinh.c' is older than target `src/libcrt/math/asinhf.o'.
    No need to remake target `src/libcrt/math/asinhf.o'.
    make: `src/libcrt/math/asinhf.o' is up to date.
    

    The pattern rules are correct; we need to identify why they are not being selected correctly, when you run make.

     
  • Thorsten Otto

    Thorsten Otto - 2014-01-24

    Thanks, but I'm not going to accept any patch which proliferates redundant source file stubs, such as asinh[fl].c

    I just followed the same scheme.

    The pattern rules are correct; we need to identify why they are not being selected correctly, when you run make.

    As posted earlier, make 3.82 is installed on my system, which is still the current one, but your version 3.81 is certainly still in use (e.g. its the one that comes with MSYS), and that is the only difference i can see here.

    If you are only concerned about redundancy: with all the stub source files in place, the pattern rules for $(math_SOURCES) are actually not needed at all.

    $ make -n -d src/libcrt/math/fabsf.o
    
    GNU Make 3.82
    Built for x86_64-unknown-linux-gnu
    ...
    Updating goal targets....
    Considering target file `src/libcrt/math/fabsf.o'.
     File `src/libcrt/math/fabsf.o' does not exist.
     Looking for an implicit rule for `src/libcrt/math/fabsf.o'.
     Trying pattern rule with stem `fabs'.
     Trying implicit prerequisite `src/libcrt/math/fabs.c'.
     Found prerequisite `src/libcrt/math/fabs.c' as VPATH `../src/libcrt/math/fabs.c'
     Found an implicit rule for `src/libcrt/math/fabsf.o'.
      Considering target file `src/libcrt/math/fabs.c'.
       Looking for an implicit rule for `src/libcrt/math/fabs.c'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.y'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.l'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.w'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.w'.
       Trying pattern rule with stem `fabs.c'.
       Trying implicit prerequisite `src/libcrt/math/fabs.c,v'.
       Trying pattern rule with stem `fabs.c'.
       Trying implicit prerequisite `src/libcrt/math/RCS/fabs.c,v'.
       Trying pattern rule with stem `fabs.c'.
       Trying implicit prerequisite `src/libcrt/math/RCS/fabs.c'.
       Trying pattern rule with stem `fabs.c'.
       Trying implicit prerequisite `src/libcrt/math/s.fabs.c'.
       Trying pattern rule with stem `fabs.c'.
       Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabs.c'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.y'.
       Looking for a rule with intermediate file `src/libcrt/math/fabs.y'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `fabs.y'.
        Trying implicit prerequisite `src/libcrt/math/fabs.y,v'.
        Trying pattern rule with stem `fabs.y'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabs.y,v'.
        Trying pattern rule with stem `fabs.y'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabs.y'.
        Trying pattern rule with stem `fabs.y'.
        Trying implicit prerequisite `src/libcrt/math/s.fabs.y'.
        Trying pattern rule with stem `fabs.y'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabs.y'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.l'.
       Looking for a rule with intermediate file `src/libcrt/math/fabs.l'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `fabs.l'.
        Trying implicit prerequisite `src/libcrt/math/fabs.l,v'.
        Trying pattern rule with stem `fabs.l'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabs.l,v'.
        Trying pattern rule with stem `fabs.l'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabs.l'.
        Trying pattern rule with stem `fabs.l'.
        Trying implicit prerequisite `src/libcrt/math/s.fabs.l'.
        Trying pattern rule with stem `fabs.l'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabs.l'.
       Trying pattern rule with stem `fabs'.
       Trying implicit prerequisite `src/libcrt/math/fabs.w'.
       Looking for a rule with intermediate file `src/libcrt/math/fabs.w'.
        Avoiding implicit rule recursion.
        Trying pattern rule with stem `fabs.w'.
        Trying implicit prerequisite `src/libcrt/math/fabs.w,v'.
        Trying pattern rule with stem `fabs.w'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabs.w,v'.
        Trying pattern rule with stem `fabs.w'.
        Trying implicit prerequisite `src/libcrt/math/RCS/fabs.w'.
        Trying pattern rule with stem `fabs.w'.
        Trying implicit prerequisite `src/libcrt/math/s.fabs.w'.
        Trying pattern rule with stem `fabs.w'.
        Trying implicit prerequisite `src/libcrt/math/SCCS/s.fabs.w'.
       Trying pattern rule with stem `fabs'.
       Rejecting impossible implicit prerequisite `src/libcrt/math/fabs.w'.
       No implicit rule found for `src/libcrt/math/fabs.c'.
       Finished prerequisites of target file `src/libcrt/math/fabs.c'.
      No need to remake target `src/libcrt/math/fabs.c'; using VPATH name `../src/libcrt/math/fabs.c'.
     Finished prerequisites of target file `src/libcrt/math/fabsf.o'.
    Must remake target `src/libcrt/math/fabsf.o'.
    Invoking recipe from Makefile:693 to update target `src/libcrt/math/fabsf.o'.
    /bin/mkdir -p src/libcrt/math
    i686-pc-mingw32-gcc -c -D FUNCTION=fabsf ...  -o src/libcrt/math/fabsf.o ../src/libcrt/math/fabs.c
    Successfully remade target file `src/libcrt/math/fabsf.o'.
    

    So the different behaviour seems to be caused by (make 3.82):

    Trying pattern rule with stem `fabs'
    

    selecting the '$(SRCDIR)/%f.o: $(SRCDIR)/%.c' pattern rule, while yours (make 3.81) read:

    Trying pattern rule with stem `fabsf'
    

    selecting the more generic '%.o : %.c' pattern rule. To verify this, i just compiled make-3.81 from sources, and with this version i got the same result as you.

    And looking at the Changelog of make, i found:

    * varible.c (create_pattern_var): Insert variables into the
    PATTERN_VARS list in the shortest patterns first order.
    
    * implicit.c (tryrule): Add STEMLEN and ORDER members. These are
    used to sort the rules.
    (stemlen_compare): Compare two tryrule elements.
    (pattern_search): Sort the rules so that they are in the shortest
    stem first order.
    

    So this behaviour has indeed changed, and actually is visible in the .FEATURES variable.

     
    Last edit: Keith Marshall 2014-01-24
  • Keith Marshall

    Keith Marshall - 2014-01-24

    So the different behaviour seems to be caused by (make 3.82):

    Trying pattern rule with stem `fabs'
    

    selecting the $(SRCDIR)/%f.o: $(SRCDIR)/%.c pattern rule, while yours (make 3.81) read:

    Trying pattern rule with stem `fabsf'
    

    selecting the more generic %.o : %.c pattern rule. To verify this, i just compiled make-3.81 from sources, and with this version i got the same result as you.

    Then, this is a regression in GNU make; we should file a bug report.

    And looking at the Changelog of make, i found:

    * varible.c (create_pattern_var): Insert variables into the
    PATTERN_VARS list in the shortest patterns first order.
    

    Seems back to front, to me. Surely, patterns should be prioritized on the basis of longest possible match first?

     
  • Keith Marshall

    Keith Marshall - 2014-01-24

    Thanks, but I'm not going to accept any patch which proliferates redundant source file stubs, such as asinh[fl].c

    I just followed the same scheme.

    Yes, you did, by copying and adapting existing redundant files which should never have existed in the first place.

    If you are only concerned about redundancy: with all the stub source files in place, ...

    It is the redundancy of maintaining all those stub files, which should not be there at all, which I object to; they must be removed, so...

    the pattern rules for $(math_SOURCES) are actually not needed at all.

    ...they most definitely are. If we are to accommodate broken GNU make-3.82, maybe they need to be expressed as static pattern rules, but the redundant files must go.

     
  • Keith Marshall

    Keith Marshall - 2014-01-24

    Thorsten,

    Following up on my own suggestion:

    ... maybe they need to be expressed as static pattern rules

    On this basis, I've created the attached alternative makefile fragment; could you please confirm that it delivers the appropriate result? For me, this is:

    $ make
    mkdir -p libobjs/libmingwex-objects
    rm -f libmingwex.a
    cd libobjs/libmingwex-objects; make -f ../../Makefile libobjdir_vpath=../../ add-libmingwex-objects
    make[1]: Entering directory `/home/keith/src/mingw/mingw-wsl-4.0-dev-hg/build/foo/libobjs/libmingwex-objects'
    mingw32-gcc    -c -o asinh.o ../../../../src/libcrt/math/asinh.c
    mingw32-gcc    -c -D FUNCTION=asinhf -o asinhf.o ../../../../src/libcrt/math/asinh.c
    mingw32-gcc    -c -D FUNCTION=asinhl -o asinhl.o ../../../../src/libcrt/math/asinh.c
    mingw32-gcc    -c -o lround.o ../../../../src/libcrt/math/lround.c
    mingw32-gcc    -c -D FUNCTION=lroundf -o lroundf.o ../../../../src/libcrt/math/lround.c
    mingw32-gcc    -c -D FUNCTION=lroundl -o lroundl.o ../../../../src/libcrt/math/lround.c
    mingw32-gcc    -c -D FUNCTION=llround -o llround.o ../../../../src/libcrt/math/lround.c
    mingw32-gcc    -c -D FUNCTION=llroundf -o llroundf.o ../../../../src/libcrt/math/lround.c
    mingw32-gcc    -c -D FUNCTION=llroundl -o llroundl.o ../../../../src/libcrt/math/lround.c
    mingw32-gcc    -c -o round.o ../../../../src/libcrt/math/round.c
    mingw32-gcc    -c -D FUNCTION=roundf -o roundf.o ../../../../src/libcrt/math/round.c
    mingw32-gcc    -c -D FUNCTION=roundl -o roundl.o ../../../../src/libcrt/math/round.c
    mingw32-gcc    -c -o fabsf.o ../../../../src/libcrt/math/fabsf.c
    mingw32-gcc    -c -o fabsl.o ../../../../src/libcrt/math/fabsl.c
    make[1]: Leaving directory `/home/keith/src/mingw/mingw-wsl-4.0-dev-hg/build/foo/libobjs/libmingwex-objects'
    mingw32-ar rcs libmingwex.a libobjs/libmingwex-objects/*.o
    
    $ mingw32-nm -A libmingwex.a | grep ' T '
    libmingwex.a:asinh.o:000000d7 T _asinh
    libmingwex.a:asinhf.o:0000008f T _asinhf
    libmingwex.a:asinhl.o:000000d7 T _asinhl
    libmingwex.a:fabsf.o:00000000 T _fabsf
    libmingwex.a:fabsl.o:00000000 T _fabsl
    libmingwex.a:llround.o:00000000 T _llround
    libmingwex.a:llroundf.o:00000000 T _llroundf
    libmingwex.a:llroundl.o:00000000 T _llroundl
    libmingwex.a:lround.o:00000000 T _lround
    libmingwex.a:lroundf.o:00000000 T _lroundf
    libmingwex.a:lroundl.o:00000000 T _lroundl
    libmingwex.a:round.o:00000000 T _round
    libmingwex.a:roundf.o:00000000 T _roundf
    libmingwex.a:roundl.o:00000000 T _roundl
    

    To test this, you will need to create a new build directory somewhere adjacent to, or within, your source tree; (I put it in ${top_srcdir}/build/foo). Drop the new Makefile in there, and adjust its top_srcdir definition to the appropriate relative path. (I guess you'll also need to adjust the CC and AR definitions to suit your own tool chain). In addition to this, you will need to:

    $ rm -f ${top_srcdir}/src/libcrt/math/asinh[fl].c
    $ rm -f ${top_srcdir}/src/libcrt/math/{,l,ll}round{,f,l}.c
    $ mv ${top_srcdir}/src/libcrt/math/round{_generic,}.c
    $ mv ${top_srcdir}/src/libcrt/math/lround{_generic,}.c
    

    to get rid of the unwanted stub files, before you test this new make strategy.

     
  • Thorsten Otto

    Thorsten Otto - 2014-01-25

    It is the redundancy of maintaining all those stub files, which should not be >there at all, which I object to; they must be removed, so...

    i'm a bit surprised that you are so concerned about a few more files ;-)
    After all, beside from the copyright notice, they all together contain no more code than the Makefile rules that are neccesary to properly compile them ;) It was just a quick solution to fix a problem that didn't exist in WSL 3.xx, if i went in the wrong direction, i apologize for that.

    Then, this is a regression in GNU make; we should file a bug report.

    I'm not familiar with the internals of make, but i guess they had a reason to change that. And as expected, the same bevaviour is also present in make 4.00.
    And even if someone there thinks this might be a bug,it took almost 3 years between release 3.82 and 4.00, so we can't expect that to be fixed soon, and it wont help for a cross-compiler, where you usually have to live with whatever make version is installed there, so we have to find a way to avoid that 'feature'.

    could you please confirm that it delivers the appropriate result?

    Sure.

    $ make
    mkdir -p libobjs/libmingwex-objects
    rm -f libmingwex.a
    cd libobjs/libmingwex-objects; make -f ../../Makefile libobjdir_vpath=../../ add-libmingwex-objects
    /home/sebilla/tmp/mingw/mingwrt-4.0.3-1-mingw32-src/build/foo/libobjs/libmingwex-objects
    make[1]: Entering directory `/home/sebilla/tmp/mingw/mingwrt-4.0.3-1-mingw32-src/build/foo/libobjs/libmingwex-objects'
    i686-pc-mingw32-gcc    -c -o asinh.o ../../../../src/libcrt/math/asinh.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=asinhf -o asinhf.o ../../../../src/libcrt/math/asinh.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=asinhl -o asinhl.o ../../../../src/libcrt/math/asinh.c
    i686-pc-mingw32-gcc    -c -o lround.o ../../../../src/libcrt/math/lround.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=lroundf -o lroundf.o ../../../../src/libcrt/math/lround.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=lroundl -o lroundl.o ../../../../src/libcrt/math/lround.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=llround -o llround.o ../../../../src/libcrt/math/lround.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=llroundf -o llroundf.o ../../../../src/libcrt/math/lround.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=llroundl -o llroundl.o ../../../../src/libcrt/math/lround.c
    i686-pc-mingw32-gcc    -c -o round.o ../../../../src/libcrt/math/round.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=roundf -o roundf.o ../../../../src/libcrt/math/round.c
    i686-pc-mingw32-gcc    -c -D FUNCTION=roundl -o roundl.o ../../../../src/libcrt/math/round.c
    i686-pc-mingw32-gcc    -c -o fabsf.o ../../../../src/libcrt/math/fabsf.c
    i686-pc-mingw32-gcc    -c -o fabsl.o ../../../../src/libcrt/math/fabsl.c
    make[1]: Leaving directory `/home/sebilla/tmp/mingw/mingwrt-4.0.3-1-mingw32-src/build/foo/libobjs/libmingwex-objects'
    i686-pc-mingw32-ar rcs libmingwex.a libobjs/libmingwex-objects/*.o
    
    $ i686-pc-mingw32-nm -A libmingwex.a | grep ' T '
    libmingwex.a:asinh.o:0000008c T _asinh
    libmingwex.a:asinhf.o:0000008c T _asinhf
    libmingwex.a:asinhl.o:000000d4 T _asinhl
    libmingwex.a:fabsf.o:00000000 T _fabsf
    libmingwex.a:fabsl.o:00000000 T _fabsl
    libmingwex.a:llround.o:00000000 T _llround
    libmingwex.a:llroundf.o:00000000 T _llroundf
    libmingwex.a:llroundl.o:00000000 T _llroundl
    libmingwex.a:lround.o:00000000 T _lround
    libmingwex.a:lroundf.o:00000000 T _lroundf
    libmingwex.a:lroundl.o:00000000 T _lroundl
    libmingwex.a:round.o:00000000 T _round
    libmingwex.a:roundf.o:00000000 T _roundf
    libmingwex.a:roundl.o:00000000 T _roundl
    

    So this indeed does work, tested with all 3 make versions (3.81, 3.82 and 4.00).

    PS.: while you are at it, the lengthy definition of w32api_lib_LIBRARIES is identical to
    $(winapi_lib_LIBRARIES) $(winapi_lib_DDK_LIBRARIES) $(winapi_lib_DIRECTX_LIBRARIES) $(winapi_lib_DIRECTX_DINPUT_LIBRARIES) $(winapi_mri_LIBRARIES) $(winapi_lib_EXTRA_LIBRARIES)

    computed near the top of the Makefile.

     
    • Keith Marshall

      Keith Marshall - 2014-01-25

      PS.: while you are at it, the lengthy definition of w32api_lib_LIBRARIES is identical to

      $(winapi_lib_LIBRARIES) $(winapi_lib_DDK_LIBRARIES)
      $(winapi_lib_DIRECTX_LIBRARIES) $(winapi_lib_DIRECTX_DINPUT_LIBRARIES) $(winapi_mri_LIBRARIES) $(winapi_lib_EXTRA_LIBRARIES)

      computed near the top of the Makefile.

      Yes, but that's a separate issue, perhaps more closely associated with my rant on ticket [#2172].

       

      Related

      Issues: #2172

  • Keith Marshall

    Keith Marshall - 2014-01-25

    It is the redundancy of maintaining all those stub files, which should not be there at all, which I object to; they must be removed, so...

    i'm a bit surprised that you are so concerned about a few more files ;-)

    I'm not concerned about a few extra files; I am concerned about the box of sticking plasters you want to use to shore up a crack in the design. The engineer in me wants to understand why that design isn't working as intended, and fix it; I do not want to paper over the cracks.

    After all, beside from the copyright notice,

    That is 23 lines of copyright declaration...

    they all together contain no more code

    ...over two lines of (barely copyrightable) effective code; how ludicrous is that? Especially given that one of those effective lines, in each case, is a #define that the properly implemented pattern rule would have passed as a -D command line assignment, and the second is a #include to compile the real source file, as the pattern rule would do directly.

    than the Makefile rules that are neccesary to properly compile them ;)

    So that's 25 lines for each and every sticking plaster, (and we've already got 12 of them); that's already 300 lines of sticking plaster, instead of around a dozen or two lines (at most) in the Makefile. Your maths doesn't stack up...

    It was just a quick solution

    But it isn't a solution; it's a kludge! Furthermore, I suspect that a proper solution will be just as simple, and perhaps even quicker to implement.

    to fix a problem that didn't exist in WSL 3.xx

    Perhaps it didn't exist, because it was implemented properly in 3.x; the original pattern rules had the design form:

    %.$(OBJEXT): %_generic.c
            $(COMPILE.c) -D FUNCTION=$* $(OUTPUT_OPTION) $<
    
    %f.$(OBJEXT): %_generic.c
            $(COMPILE.c) -D FUNCTION=$*f $(OUTPUT_OPTION) $<
    
    %l.$(OBJEXT): %_generic.c
            $(COMPILE.c) -D FUNCTION=$*l $(OUTPUT_OPTION) $<
    

    (Yes, that's only six effective lines, compared to your 300 of sticking plaster, but there is a small additional overhead for special cases, such as the llround functions). The real issue here seems to be that the _generic suffix to the stem of the function name representation, in the associated source file name, got dropped from the pattern rules in 4.x, to be replaced by the first sticking plaster; that would likely be where it started going wrong.

     
  • Keith Marshall

    Keith Marshall - 2014-01-25

    Perhaps it didn't exist, because it was implemented properly in 3.x; the original pattern rules had the design form...

    Sure enough, if I adapt the Makefile from my trial yesterday, as attached, reinstate the round_generic.c, and lround_generic.c sources, rename the asinh.c source to asinh_generic.c, and remove all the sticking plasters, I still achieve a successful outcome:

    $ rm -rf libobjs/
    
    $ make
    mkdir -p libobjs/libmingwex-objects
    rm -f libmingwex.a
    cd libobjs/libmingwex-objects; make -f ../../Makefile libobjdir_vpath=../../ add-libmingwex-objects
    make[1]: Entering directory `/home/keith/src/mingw/mingw-wsl-4.0-dev-hg/build/foo/libobjs/libmingwex-objects'
    mingw32-gcc    -c -D FUNCTION=asinh -o asinh.o ../../../../src/libcrt/math/asinh_generic.c
    mingw32-gcc    -c -D FUNCTION=asinhf -o asinhf.o ../../../../src/libcrt/math/asinh_generic.c
    mingw32-gcc    -c -D FUNCTION=asinhl -o asinhl.o ../../../../src/libcrt/math/asinh_generic.c
    mingw32-gcc    -c -D FUNCTION=lround -o lround.o ../../../../src/libcrt/math/lround_generic.c
    mingw32-gcc    -c -D FUNCTION=lroundf -o lroundf.o ../../../../src/libcrt/math/lround_generic.c
    mingw32-gcc    -c -D FUNCTION=lroundl -o lroundl.o ../../../../src/libcrt/math/lround_generic.c
    mingw32-gcc    -c -D FUNCTION=llround -o llround.o ../../../../src/libcrt/math/lround_generic.c
    mingw32-gcc    -c -D FUNCTION=llroundf -o llroundf.o ../../../../src/libcrt/math/lround_generic.c
    mingw32-gcc    -c -D FUNCTION=llroundl -o llroundl.o ../../../../src/libcrt/math/lround_generic.c
    mingw32-gcc    -c -D FUNCTION=round -o round.o ../../../../src/libcrt/math/round_generic.c
    mingw32-gcc    -c -D FUNCTION=roundf -o roundf.o ../../../../src/libcrt/math/round_generic.c
    mingw32-gcc    -c -D FUNCTION=roundl -o roundl.o ../../../../src/libcrt/math/round_generic.c
    mingw32-gcc    -c -o fabsf.o ../../../../src/libcrt/math/fabsf.c
    mingw32-gcc    -c -o fabsl.o ../../../../src/libcrt/math/fabsl.c
    make[1]: Leaving directory `/home/keith/src/mingw/mingw-wsl-4.0-dev-hg/build/foo/libobjs/libmingwex-objects'
    mingw32-ar rcs libmingwex.a libobjs/libmingwex-objects/*.o
    
    $ mingw32-nm -A libmingwex.a | grep ' T '
    libmingwex.a:asinh.o:000000d7 T _asinh
    libmingwex.a:asinhf.o:0000008f T _asinhf
    libmingwex.a:asinhl.o:000000d7 T _asinhl
    libmingwex.a:fabsf.o:00000000 T _fabsf
    libmingwex.a:fabsl.o:00000000 T _fabsl
    libmingwex.a:llround.o:00000000 T _llround
    libmingwex.a:llroundf.o:00000000 T _llroundf
    libmingwex.a:llroundl.o:00000000 T _llroundl
    libmingwex.a:lround.o:00000000 T _lround
    libmingwex.a:lroundf.o:00000000 T _lroundf
    libmingwex.a:lroundl.o:00000000 T _lroundl
    libmingwex.a:round.o:00000000 T _round
    libmingwex.a:roundf.o:00000000 T _roundf
    libmingwex.a:roundl.o:00000000 T _roundl
    

    That's with exactly eight lines of effective makefile code, in pattern rules, versus 300 lines of sticking plaster. Unless you tell me this doesn't work for you, I'll work toward a solution on this basis.

     
  • Thorsten Otto

    Thorsten Otto - 2014-01-26

    That's with exactly eight lines of effective makefile code, in pattern rules, >versus 300 lines of sticking plaster

    Thats a bit unfair, not all of those 300 lines where from the patch ;)
    And it is a common practice i've seen/used several times before, but those projects used automake mostly, and probably didnt want to rely on gmake features.

    Unless you tell me this doesn't work for you, I'll work toward a solution on >this basis.

    It does work, again tested with all 3 version of make.
    The only small problem is that now

    mingw32-ar rcs libmingwex.a libobjs/libmingwex-objects/*.o
    

    is always executed.

    Perhaps it didn't exist, because it was implemented properly in 3.x

    Even if it did exist, in native builds this would not have been noticed before, because msys 1.0 comes with make 3.81.

    PS.: is there some better place to discuss general problems/suggestions?

     
    Last edit: Thorsten Otto 2014-01-26
  • Keith Marshall

    Keith Marshall - 2014-01-26

    That's with exactly eight lines of effective makefile code, in pattern rules, versus 300 lines of sticking plaster

    Thats a bit unfair, not all of those 300 lines where from the patch ;)

    I didn't mean to imply that they were. Someone else had already started the rot; your patch just added to it. It's time to stop it.

    Unless you tell me this doesn't work for you, I'll work toward a solution on this basis.

    It does work, again tested with all 3 version of make.

    Thanks. I guess this is the way to go, then. I'll work up a new patch, to integrate this into the existing Makefile.in; the rest of the rubbish can be cleaned up later -- better to progress gradually, than to rush headlong into too much too quickly.

     
  • Keith Marshall

    Keith Marshall - 2014-01-27

    The only small problem is that now

    mingw32-ar rcs libmingwex.a libobjs/libmingwex-objects/*.o
    

    is always executed.

    Is that such a problem? I think not, really. Anyhow, this was just a proof of concept; a final implementation should address the dependency, such that libmingwex.a would be regenerated only when any of libobjs/libmingwex-objects/*.o (or however else they may ultimately be called) changes.

    PS.: is there some better place to discuss general problems/suggestions?

    On the general MinGW-Users mailing list perhaps, or if you'd like to become more involved, consider joining the development team.

     
  • Keith Marshall

    Keith Marshall - 2014-01-27

    I committed this (on branch 4.0-dev only, for now). It's still hideously ugly -- and the ugliness made this patch more difficult to formulate than it should have been -- but a formal clean up will have to wait.

    I presume this should be good to close, now.

     
  • Keith Marshall

    Keith Marshall - 2014-01-27
    • status: unread --> pending
    • assigned_to: Keith Marshall
    • Resolution: none --> fixed
    • Category: Unknown --> IINR_-_Include_In_Next_Release
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks