Menu

#22 compile fails on SLES10:

open
nobody
None
2014-08-25
2013-07-03
No

I'm building on SUSE SLES10. This is one of those professional systems with really outdated (but stable) SW versions. :-)

These are the relevant pieces:

> rpm -q glibc kernel-smp
glibc-2.4-31.77.84.1
kernel-smp-2.6.16.60-0.58.1.3835.0.PTF.638363

Building dmtcp fails with:

 g++ -DHAVE_CONFIG_H -I.    -fPIC -g -O2 -MT filewrappers.o -MD -MP -MF .deps/filewrappers.Tpo -c -o filewrappers.o filewrappers.cpp
 filewrappers.cpp: In function 'int readlink(const char*, char*, size_t)':
 filewrappers.cpp:562:52: error: declaration of C function 'int readlink(const char*, char*, size_t)' conflicts with
 /usr/include/unistd.h:773:16: error: previous declaration 'ssize_t readlink(const char*, char*, size_t)' here

Quick inspection of the code shows that ./dmtcp/src/syscallwrappers.h defines this:

#if __GLIBC_PREREQ(2,5)
# define READLINK_RET_TYPE ssize_t
#else
# define READLINK_RET_TYPE int
#endif

but the local version of readlink in glibc-2.4's /usr/include/unistd.h is defined as such:

extern ssize_t readlink (__const char *__restrict __path,
                         char *__restrict __buf, size_t __len)
     __THROW __nonnull ((1, 2)) __wur;

If I change

 #if __GLIBC_PREREQ(2,5)

to

 #if __GLIBC_PREREQ(2,4)

the compile completes nicely.

I must say I do not know whether SUSE has modified these headers. I can just report what it is like on this system. (SLES10 is not quite EOL = end of life yet.)

Indeed, SUSE's headers differ from what I can see in glibc's 2.4 git:

http://sourceware.org/git/?p=glibc.git;a=tree;h=280ca2fcf92f8a2b01f7d5c1aaeef093c21954e1;hb=3858bf28a66f449cc2d815122032a60cf9bf793e

and look more like what I find in glibc's 2.5 git. Sigh.

Perhaps an autoconf check for the return type of readlink would be more appropriate, if such is even possible.

Do close as irrelevant if you don't see a chance of fixing. (Might be worth a note in the docs.) That said, it doesn't build out-of-the-box for me on SLES11 either. More in a separate ticket.

Related

Bugs: #22

Discussion

  • Gene Cooperman

    Gene Cooperman - 2013-07-09

    Thanks for this bug report. We'll look at fixing this for compatibility
    with SLES10. I'm guessing that you're using DMTCP version 1.2.7.
    Is this the case?

    Thanks,
    - Gene

    On Wed, Jul 03, 2013 at 09:17:34AM +0000, Moritz Barsnick wrote:


    [bugs:#22] compile fails on SLES10:

    Status: open
    Created: Wed Jul 03, 2013 09:17 AM UTC by Moritz Barsnick
    Last Updated: Wed Jul 03, 2013 09:17 AM UTC
    Owner: nobody

    I'm building on SUSE SLES10. This is one of those professional systems with really outdated (but stable) SW versions. :-)

    These are the relevant pieces:
    ~~~~~~

    rpm -q glibc kernel-smp
    glibc-2.4-31.77.84.1
    kernel-smp-2.6.16.60-0.58.1.3835.0.PTF.638363
    ~~~~~~

    Building dmtcp fails with:

    ~~~~~~
    g++ -DHAVE_CONFIG_H -I. -fPIC -g -O2 -MT filewrappers.o -MD -MP -MF .deps/filewrappers.Tpo -c -o filewrappers.o filewrappers.cpp
    filewrappers.cpp: In function 'int readlink(const char, char, size_t)':
    filewrappers.cpp:562:52: error: declaration of C function 'int readlink(const char, char, size_t)' conflicts with
    /usr/include/unistd.h:773:16: error: previous declaration 'ssize_t readlink(const char, char, size_t)' here
    ~~~~~~

    Quick inspection of the code shows that ./dmtcp/src/syscallwrappers.h defines this:

    ~~~~~~

    if __GLIBC_PREREQ(2,5)

    define READLINK_RET_TYPE ssize_t

    else

    define READLINK_RET_TYPE int

    endif

    ~~~~~~

    but the local version of readlink in glibc-2.4's /usr/include/unistd.h is defined as such:

    ~~~~~~
    extern ssize_t readlink (const char *restrict path,
    char *
    restrict buf, size_t len)
    THROW nonnull ((1, 2)) __wur;
    ~~~~~~

    If I change

    ~~~~~~
    #if __GLIBC_PREREQ(2,5)
    ~~~~~~
    to

    ~~~~~~
    #if __GLIBC_PREREQ(2,4)
    ~~~~~~

    the compile completes nicely.

    I must say I do not know whether SUSE has modified these headers. I can just report what it is like on this system. (SLES10 is not quite EOL = end of life yet.)

    Indeed, SUSE's headers differ from what I can see in glibc's 2.4 git:

    http://sourceware.org/git/?p=glibc.git;a=tree;h=280ca2fcf92f8a2b01f7d5c1aaeef093c21954e1;hb=3858bf28a66f449cc2d815122032a60cf9bf793e

    and look more like what I find in glibc's 2.5 git. Sigh.

    Perhaps an autoconf check for the return type of readlink would be more appropriate, if such is even possible.

    Do close as irrelevant if you don't see a chance of fixing. (Might be worth a note in the docs.) That said, it doesn't build out-of-the-box for me on SLES11 either. More in a separate ticket.


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dmtcp/bugs/22/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #22

  • Gene Cooperman

    Gene Cooperman - 2013-07-18

    Hi Moritz,
    I was looking further into the compilation for SLES10/glibc-2.4.
    It's all exactly as you say: the SLES10/glibc-2.4 declaration for readlink
    is closer to that of glibc-2.5.
    Since SLES10 is near end-of-life, and the compiler error message makes
    it clear how the end user can patch this, I'm tempted to not put in special
    conditionalizations or configure tests for this. But if I see similar
    examples of this type of problem, I will fix this issue.
    Hence, I'm really interested in your other statement:

    That said, it doesn't build out-of-the-box for me on SLES11 either.
    More in a separate ticket.
    Could you let us know what issues you're seeing on SLES11? If we can
    get a better idea of the compilation issues on SLES in general, we can
    think carefully about the best overall solution.

    Thanks,
    - Gene

    On Wed, Jul 03, 2013 at 09:17:34AM +0000, Moritz Barsnick wrote:


    [bugs:#22] compile fails on SLES10:

    Status: open
    Created: Wed Jul 03, 2013 09:17 AM UTC by Moritz Barsnick
    Last Updated: Wed Jul 03, 2013 09:17 AM UTC
    Owner: nobody

    I'm building on SUSE SLES10. This is one of those professional systems with really outdated (but stable) SW versions. :-)

    These are the relevant pieces:
    ~~~~~~

    rpm -q glibc kernel-smp
    glibc-2.4-31.77.84.1
    kernel-smp-2.6.16.60-0.58.1.3835.0.PTF.638363
    ~~~~~~

    Building dmtcp fails with:

    ~~~~~~
    g++ -DHAVE_CONFIG_H -I. -fPIC -g -O2 -MT filewrappers.o -MD -MP -MF .deps/filewrappers.Tpo -c -o filewrappers.o filewrappers.cpp
    filewrappers.cpp: In function 'int readlink(const char, char, size_t)':
    filewrappers.cpp:562:52: error: declaration of C function 'int readlink(const char, char, size_t)' conflicts with
    /usr/include/unistd.h:773:16: error: previous declaration 'ssize_t readlink(const char, char, size_t)' here
    ~~~~~~

    Quick inspection of the code shows that ./dmtcp/src/syscallwrappers.h defines this:

    ~~~~~~

    if __GLIBC_PREREQ(2,5)

    define READLINK_RET_TYPE ssize_t

    else

    define READLINK_RET_TYPE int

    endif

    ~~~~~~

    but the local version of readlink in glibc-2.4's /usr/include/unistd.h is defined as such:

    ~~~~~~
    extern ssize_t readlink (const char *restrict path,
    char *
    restrict buf, size_t len)
    THROW nonnull ((1, 2)) __wur;
    ~~~~~~

    If I change

    ~~~~~~
    #if __GLIBC_PREREQ(2,5)
    ~~~~~~
    to

    ~~~~~~
    #if __GLIBC_PREREQ(2,4)
    ~~~~~~

    the compile completes nicely.

    I must say I do not know whether SUSE has modified these headers. I can just report what it is like on this system. (SLES10 is not quite EOL = end of life yet.)

    Indeed, SUSE's headers differ from what I can see in glibc's 2.4 git:

    http://sourceware.org/git/?p=glibc.git;a=tree;h=280ca2fcf92f8a2b01f7d5c1aaeef093c21954e1;hb=3858bf28a66f449cc2d815122032a60cf9bf793e

    and look more like what I find in glibc's 2.5 git. Sigh.

    Perhaps an autoconf check for the return type of readlink would be more appropriate, if such is even possible.

    Do close as irrelevant if you don't see a chance of fixing. (Might be worth a note in the docs.) That said, it doesn't build out-of-the-box for me on SLES11 either. More in a separate ticket.


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dmtcp/bugs/22/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #22

  • Moritz Barsnick

    Moritz Barsnick - 2013-07-18

    Hi Gene,
    thanks for looking at it.

    I agree, it's probably not worth fixing for this one scenario. I disagree though that it's obvious to the user. (It wasn't to me, and I'm a programmer/power builder. :-)) I would at least recommend a note in the appropriate documentation.

    I promise to follow up on the SLES11 issue. Glad to see you're interested.

     
  • Gene Cooperman

    Gene Cooperman - 2013-07-26

    Hi Moritz,
    Sorry for the late reply again. Travelling, and I'm now catching up.

    Thanks again for your comments. And please do let us know what happens
    with SLES11 when you get to it.

    As for SLES10, I'll be adding to the 1.2 branch of the svn a comment above the
    definition of readlink() in filewrappers.cpp :
    // NOTE: If you see a compiler error: "declaration of C function ... conflicts
    // with ... unistd.h", then consider changing READLINK_RET_TYPE in
    // syscallwrappers.h. A user has reported this was needed for Linux SLES10.

    If someone comes across this bug, the compiler error will direct them
    to the line containing the definition of readlink() in filewrappers.cpp.
    So, this comment should document what they need to do next.
    I'm adding a similar comment in the svn trunk.

    I'll be checking this in sometime in the next few days. So, it's still
    easy to change the comment for greater clarity. (It's always good to have
    two pairs of eyes look these things over.)

    Best,
    - Gene

    On Thu, Jul 18, 2013 at 06:22:20PM +0000, Moritz Barsnick wrote:

    Hi Gene,
    thanks for looking at it.

    I agree, it's probably not worth fixing for this one scenario. I disagree though that it's obvious to the user. (It wasn't to me, and I'm a programmer/power builder. :-)) I would at least recommend a note in the appropriate documentation.

    I promise to follow up on the SLES11 issue. Glad to see you're interested.


    [bugs:#22] compile fails on SLES10:

    Status: open
    Created: Wed Jul 03, 2013 09:17 AM UTC by Moritz Barsnick
    Last Updated: Wed Jul 03, 2013 09:17 AM UTC
    Owner: nobody

    I'm building on SUSE SLES10. This is one of those professional systems with really outdated (but stable) SW versions. :-)

    These are the relevant pieces:
    ~~~~~~

    rpm -q glibc kernel-smp
    glibc-2.4-31.77.84.1
    kernel-smp-2.6.16.60-0.58.1.3835.0.PTF.638363
    ~~~~~~

    Building dmtcp fails with:

    ~~~~~~
    g++ -DHAVE_CONFIG_H -I. -fPIC -g -O2 -MT filewrappers.o -MD -MP -MF .deps/filewrappers.Tpo -c -o filewrappers.o filewrappers.cpp
    filewrappers.cpp: In function 'int readlink(const char, char, size_t)':
    filewrappers.cpp:562:52: error: declaration of C function 'int readlink(const char, char, size_t)' conflicts with
    /usr/include/unistd.h:773:16: error: previous declaration 'ssize_t readlink(const char, char, size_t)' here
    ~~~~~~

    Quick inspection of the code shows that ./dmtcp/src/syscallwrappers.h defines this:

    ~~~~~~

    if __GLIBC_PREREQ(2,5)

    define READLINK_RET_TYPE ssize_t

    else

    define READLINK_RET_TYPE int

    endif

    ~~~~~~

    but the local version of readlink in glibc-2.4's /usr/include/unistd.h is defined as such:

    ~~~~~~
    extern ssize_t readlink (const char *restrict path,
    char *
    restrict buf, size_t len)
    THROW nonnull ((1, 2)) __wur;
    ~~~~~~

    If I change

    ~~~~~~
    #if __GLIBC_PREREQ(2,5)
    ~~~~~~
    to

    ~~~~~~
    #if __GLIBC_PREREQ(2,4)
    ~~~~~~

    the compile completes nicely.

    I must say I do not know whether SUSE has modified these headers. I can just report what it is like on this system. (SLES10 is not quite EOL = end of life yet.)

    Indeed, SUSE's headers differ from what I can see in glibc's 2.4 git:

    http://sourceware.org/git/?p=glibc.git;a=tree;h=280ca2fcf92f8a2b01f7d5c1aaeef093c21954e1;hb=3858bf28a66f449cc2d815122032a60cf9bf793e

    and look more like what I find in glibc's 2.5 git. Sigh.

    Perhaps an autoconf check for the return type of readlink would be more appropriate, if such is even possible.

    Do close as irrelevant if you don't see a chance of fixing. (Might be worth a note in the docs.) That said, it doesn't build out-of-the-box for me on SLES11 either. More in a separate ticket.


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/dmtcp/bugs/22/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #22


Log in to post a comment.