You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2007/11/29 19:13:43 UTC

[jira] Created: (STDCXX-675) [MSVC] implement autolinking feature

[MSVC] implement autolinking feature
------------------------------------

                 Key: STDCXX-675
                 URL: https://issues.apache.org/jira/browse/STDCXX-675
             Project: C++ Standard Library
          Issue Type: Improvement
          Components: Configuration
    Affects Versions: 4.2.0, 4.1.4, 4.1.3, 4.1.2
         Environment: MSVC, ICC/Windows
            Reporter: Farid Zaripov
            Assignee: Farid Zaripov
            Priority: Trivial
             Fix For: 4.2.1


At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).

The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Travis Vitek (JIRA) [mailto:jira@apache.org] 
>> Sent: Wednesday, December 19, 2007 1:22 AM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: [jira] Commented: (STDCXX-675) [MSVC] implement 
>> autolinking feature
>>
>>
>>     [ 
>> https://issues.apache.org/jira/browse/STDCXX-675?page=com.atla
>> ssian.jira.plugin.system.issuetabpanels:comment-tabpanel#actio
>> n_12552933 ] 
>>
>> Travis Vitek commented on STDCXX-675:
>> -------------------------------------
>>
>> If the new user takes advantage of the autolinking feature, 
>> they will have to modify their build system to get it to work 
>> with a previous version of the library. i.e. they will need 
>> to explicitly link the library file when they go back to 4.2.0.
> 
>   You're right, but what the type of incompatibility of this case? :)
> Source? - No, because there no source changes. Binary? - No again :)

I agree, it's a gray area.

The general rule of thumb I tend use for maintenance releases is that
they must be hassle-free drop-in replacements for each other. I.e., it
should be just as easy to swap in the previous release into a project
built with a maintenance release as it is in the opposite direction.
The safest way to achieve this goal is to refrain from implementing
any enhancements in maintenance releases and restrict changes to
bug fixes only. Even then, though, an argument could be made that
if a user program builds against the maintenance release and relies
on a bug fix implemented in the release they may not be able to
simply drop in a prior version and expect the program to work as
before.

> 
>> Will this ever be useful for any compiler other than MSVC and 
>> ICC/Windows?
> 
>   Yes, if the autolinking feature will be implemented there :)
> 
>> Is there a way that we can ensure the user links 
>> the right library on all platforms?
> 
>   We can define some symbol in the library with the unique name
> for the each build type, and make the reference to this symbol
> in <config.h>. Then in case the linking with incorrect library
> the "undefined symbol reference" linker error will be issued.

It might be worth exploring this idea a bit before making a decision.
If it turns out we're not completely comfortable with the solution
for 4.2.1 there's always 4.3.

Martin

> 
>> This wouldn't avoid the 
>> need to explicitly link the library, but it would eliminate 
>> issues with linking the wrong library.
> 
>   Right.
> 
> Farid.
> 


RE: [jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Travis Vitek (JIRA) [mailto:jira@apache.org] 
> Sent: Wednesday, December 19, 2007 1:22 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: [jira] Commented: (STDCXX-675) [MSVC] implement 
> autolinking feature
> 
> 
>     [ 
> https://issues.apache.org/jira/browse/STDCXX-675?page=com.atla
> ssian.jira.plugin.system.issuetabpanels:comment-tabpanel#actio
> n_12552933 ] 
> 
> Travis Vitek commented on STDCXX-675:
> -------------------------------------
> 
> If the new user takes advantage of the autolinking feature, 
> they will have to modify their build system to get it to work 
> with a previous version of the library. i.e. they will need 
> to explicitly link the library file when they go back to 4.2.0.

  You're right, but what the type of incompatibility of this case? :)
Source? - No, because there no source changes. Binary? - No again :)

> Will this ever be useful for any compiler other than MSVC and 
> ICC/Windows?

  Yes, if the autolinking feature will be implemented there :)

> Is there a way that we can ensure the user links 
> the right library on all platforms?

  We can define some symbol in the library with the unique name
for the each build type, and make the reference to this symbol
in <config.h>. Then in case the linking with incorrect library
the "undefined symbol reference" linker error will be issued.

> This wouldn't avoid the 
> need to explicitly link the library, but it would eliminate 
> issues with linking the wrong library.

  Right.

Farid.

[jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552933 ] 

Travis Vitek commented on STDCXX-675:
-------------------------------------

If the new user takes advantage of the autolinking feature, they will have to modify their build system to get it to work with a previous version of the library. i.e. they will need to explicitly link the library file when they go back to 4.2.0.

Will this ever be useful for any compiler other than MSVC and ICC/Windows? Is there a way that we can ensure the user links the right library on all platforms? This wouldn't avoid the need to explicitly link the library, but it would eliminate issues with linking the wrong library.


> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>         Attachments: autolink.patch
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov updated STDCXX-675:
---------------------------------

    Patch Info: [Patch Available]

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>         Attachments: autolink.patch
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547221 ] 

Farid Zaripov commented on STDCXX-675:
--------------------------------------

ChangeLog:

STDCXX-675
  * include/rw/_autolink.h: New header file to enable autolinking feature.
  * include/rw/_config-msvcrt.h: #include _autolink.h.
  * src/export.cpp: Added missing #define _RWSTD_LIB_SRC macro.

The _autolink.h file is intended to be #included in _config.h, but since this feature is supported by only MSVC and ICC/Windows, it #included in _config-msvcrt.h.

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>         Attachments: autolink.patch
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546878 ] 

Martin Sebor commented on STDCXX-675:
-------------------------------------

I don't know of any UNIX compiler that has a feature like this.

It seems like it might be worth looking into at least on Windows.

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov updated STDCXX-675:
---------------------------------

    Attachment: autolink.patch

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>         Attachments: autolink.patch
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551854 ] 

Martin Sebor commented on STDCXX-675:
-------------------------------------

Is this change forward compatible?

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>         Attachments: autolink.patch
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546826 ] 

Farid Zaripov commented on STDCXX-675:
--------------------------------------

Perhaps the another compilers may has the similar feature.

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-675) [MSVC] implement autolinking feature

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552841 ] 

Farid Zaripov commented on STDCXX-675:
--------------------------------------

Yes. This change doesn't affect the exported symbols or anything else. It's only add's the record in object files, compiled with using this change, to link these object files with libstdxx.lib.

> [MSVC] implement autolinking feature
> ------------------------------------
>
>                 Key: STDCXX-675
>                 URL: https://issues.apache.org/jira/browse/STDCXX-675
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: MSVC, ICC/Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2.1
>
>         Attachments: autolink.patch
>
>
> At the moment the users of the library should explicitly specify the used library name in linker command line. Here might be problems if the user's project was compiled with config.h for some configuration (let's say 12d) but linked with library for another configuration (i.e. libstd12s.lib).
> The MSVC and ICC/Windows has the posibility to specify the library using #pragma comment (lib, libname) directive. So #including any header from the library will leads to linking automatically with the proper library file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.