#57 Squelch -fPIC on x86_64 warnings

closed-wont-fix
nobody
Other (13)
5
2012-08-07
2012-06-20
Sean McGovern
No

Please consider not warning about using -fPIC on x86_64. The message is non-fatal and having an explicit exception to compile with mingw-w64 is overkill.

Discussion

  • Jonathan Yong
    Jonathan Yong
    2012-06-20

    • labels: --> Other
     
  • Jonathan Yong
    Jonathan Yong
    2012-06-20

    The correct fix is to remove -fpic from the command line. Not only does it do nothing, silencing it will imply it is actually an accepted argument.

    This is bad practice and should be fixed on the user side.

     
  • Sean McGovern
    Sean McGovern
    2012-06-20

    I'm not sure I understand this logic. I'm asking for PIC, and getting PIC. That building without PIC is incorrect on this platform is secondary.

    No other gcc flag generates a warning when the default is requested.

     
  • NightStrike
    NightStrike
    2012-06-20

    I'd tend to agree with Sean here. Now, if we hid a warning on -fno-pic (if such an option exists), that'd be a different story. But the paradigm of gcc has always been to silently accept redundant options.

     
  • Jonathan Yong
    Jonathan Yong
    2012-06-20

    I should explain better that PIC code has no place in PE, it is an ELF specific flag. So setting -fpic or -fno-pic is pointless on Windows.

    Not emitting a warning is bad since it will lead to users to assume PIC is needed for Win64. This is blatantly false. __PIC__ and associated macros are not even defined if -fpic is used for mingw/Cygwin targets.

     
  • Jonathan Yong
    Jonathan Yong
    2012-06-20

    To add more, if we allow -fpic, it will only be a matter of time before somebody ask that all the associated __PIC__ macros are activated, this is plain wrong for Windows since there is no concept of PIC/PIE there.

    IMHO, what you are asking will open a can of worms.

    NS: There is no concept of PIC on Windows, this request is akin to hiding the symptom rather than fixing the problem.

     
  • Sean McGovern
    Sean McGovern
    2012-08-07

    Closing as later. Feel free to re-open if you believe this to have been in error.

     
  • Sean McGovern
    Sean McGovern
    2012-08-07

    • status: open --> closed-later
     
  • Jonathan Yong
    Jonathan Yong
    2012-08-07

    No please, the warning is valid, -fpic is not something for win32 PE, the correct procedure is not to use it for mingw*.

    In fact, I think it should be an error to use it, gcc should treat it as an unknown argument.

     
  • Jonathan Yong
    Jonathan Yong
    2012-08-07

    • status: closed-later --> closed-wont-fix