mainGNU Libtool - Support: sr #111245, MSVC removes MAGIC_EXE when -Gw or...

 
 

sr #111245: MSVC removes MAGIC_EXE when -Gw or -GL is specified

Submitter:  None
Submitted:  Fri 23 May 2025 08:47:19 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  Microsoft Windows
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Fri 23 May 2025 08:47:19 AM UTC, original submission:  

In lt-main.in, MAGIC_EXE hold a magic string to distinguish it whether it is a wrapper executable or not. It's ok on GCC because _attribute_((externally_visible)) was applied. However, in MSVC, it doesn't have the similar attributes, then it would be eliminated by -Gw option (an option like -fdata-sections).

There are two possible solutions came to my mind.

1. Use __pragma(comment(linker, "/INCLUDE:MAGIC_EXE"))
    It places /INCLUDE:symbol_name option to linker, but please noticed that the symbol name is _MAGIC_EXE instead of MAGIC_EXE in x86 (32-bit).

2. Use (void) MAGIC_EXE in any function
    It mark MAGIC_EXE as used (even in a strange way) prevent the effect of -Gw. Yeah, I don't think it is a good way that MSVC doesn't change this behavior in future.

3. Use another strings to do so
    e.g. "libtool-wrapper" or "libtool wrapper (GNU $PACKAGE) $VERSION". I don't think user will uses these strings in their programs.

Anonymous

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

History

No changes have been made to this item

Back to the top

Powered by Savane 3.16-598c.
Corresponding source code