Your message dated Wed, 27 May 2015 19:27:02 +0200
with message-id <[email protected]>
and subject line Re: Bug#786954: [dpkg-shlibdeps] missed to trace the symbol 
<atan> from libm?
has caused the Debian Bug report #786954,
regarding [dpkg-shlibdeps] missed to trace the symbol <atan> from libm?
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
786954: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786954
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dpkg-dev
Version: 1.17.25
Severity: normal

Hi,

When I'm reading osamu's new maint-guide and playing around,
I found a issue with dpkg-shlibdeps. It says so:

        dpkg-shlibdeps: warning: package could avoid a useless
        dependency if debian/debhello-1.0/usr/bin/hello was not linked
        against libm.so.6 (it uses none of the library's symbols)
        
however the program hello.c indeed used math.h and should be 
linked to libm:

        #include "config.h"
        #include <math.h>
        #include <stdio.h>
        int
        main()
        {
                printf("Hello, I am " PACKAGE_AUTHOR "!\n");
                printf("4.0 * atan(1.0) = %10f8\n", 4.0*atan(1.0));
                return 0;
        }
        
I'm sure the generated ELF hello should be linked to libm, 
and atan() is really a libm function.

        $ objdump -d libm-2.19.so | grep \<atan
        0000000000019ba0 <atan>:
           19baf:       75 27                   jne    19bd8 <atan+0x38>

Does dpkg-shlibdeps missed to trace the symbol "atan"?

the full package build script is available as attachment [1.0.log.gz]
the software debhello-1.0 is from osamu's people.d.o [1]

[1] https://people.debian.org/~osamu/debhello.tar.xz

Attachment: 1.0.log.gz
Description: application/gzip


--- End Message ---
--- Begin Message ---
Hi!

On Wed, 2015-05-27 at 05:33:59 +0000, lumin wrote:
> Package: dpkg-dev
> Version: 1.17.25
> Severity: normal

> When I'm reading osamu's new maint-guide and playing around,
> I found a issue with dpkg-shlibdeps. It says so:
> 
>         dpkg-shlibdeps: warning: package could avoid a useless
>         dependency if debian/debhello-1.0/usr/bin/hello was not linked
>         against libm.so.6 (it uses none of the library's symbols)
>         
> however the program hello.c indeed used math.h and should be 
> linked to libm:
> 
>         #include "config.h"
>         #include <math.h>
>         #include <stdio.h>
>         int
>         main()
>         {
>                 printf("Hello, I am " PACKAGE_AUTHOR "!\n");
>                 printf("4.0 * atan(1.0) = %10f8\n", 4.0*atan(1.0));
>                 return 0;
>         }

It might or might not be using symbols from libm. Consider that the
compiler (in this case gcc) has a list of builtin functions that it
recognizes and tries to compute its results at compilation time, if
it can and if optimizing and probably other criterion. In this case
you should see that atan is not being used from the hello.c program
by using «objdump -T hello».

It might be used if you do:

  ,---
  int calc(float a, float a) { return a * atan(b); }
  int main() { printf("4.0 * atan(1.0) = %f\n", calc(4.0, 1.0)); return 0; }
  `---

> I'm sure the generated ELF hello should be linked to libm, 
> and atan() is really a libm function.
> 
>         $ objdump -d libm-2.19.so | grep \<atan
>         0000000000019ba0 <atan>:
>            19baf:     75 27                   jne    19bd8 <atan+0x38>

Try disassembling the compiled program and you'll see that it's not
used in the main() function.

But, you cannot stop linking against -lm because that would be an
unportable assumption, and the program might break depending on the
compiler usage.

> Does dpkg-shlibdeps missed to trace the symbol "atan"?

Nope, as stated above it was simply not being used from libm. There
is #689603, which is related but no the same request. Given all this
I'm thus closing this bug report.

Thanks,
Guillem

--- End Message ---

Reply via email to