<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>I would like to ask about <span style="color: rgb(36, 41, 46);
        font-family: SFMono-Regular, Consolas, "Liberation
        Mono", Menlo, Courier, monospace; font-size: 11.9px;
        font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: normal; letter-spacing:
        normal; orphans: 2; text-align: left; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgba(27, 31, 35, 0.05); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">POSITION_INDEPENDENT_CODE</span>
      target property. As of CMake 3.8.2 <span style="color: rgb(36,
        41, 46); font-family: SFMono-Regular, Consolas, "Liberation
        Mono", Menlo, Courier, monospace; font-size: 11.9px;
        font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: normal; letter-spacing:
        normal; orphans: 2; text-align: left; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgba(27, 31, 35, 0.05); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">POSITION_INDEPENDENT_CODE</span>
      appends <span style="color: rgb(36, 41, 46); font-family:
        SFMono-Regular, Consolas, "Liberation Mono", Menlo,
        Courier, monospace; font-size: 11.9px; font-style: normal;
        font-variant-ligatures: normal; font-variant-caps: normal;
        font-weight: normal; letter-spacing: normal; orphans: 2;
        text-align: left; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgba(27, 31,
        35, 0.05); text-decoration-style: initial;
        text-decoration-color: initial; display: inline !important;
        float: none;">-fPIE</span> or <span style="color: rgb(36, 41,
        46); font-family: SFMono-Regular, Consolas, "Liberation
        Mono", Menlo, Courier, monospace; font-size: 11.9px;
        font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: normal; letter-spacing:
        normal; orphans: 2; text-align: left; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgba(27, 31, 35, 0.05); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">-fPIC</span> to <span style="color:
        rgb(36, 41, 46); font-family: SFMono-Regular, Consolas,
        "Liberation Mono", Menlo, Courier, monospace;
        font-size: 11.9px; font-style: normal; font-variant-ligatures:
        normal; font-variant-caps: normal; font-weight: normal;
        letter-spacing: normal; orphans: 2; text-align: left;
        text-indent: 0px; text-transform: none; white-space: normal;
        widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgba(27, 31, 35, 0.05); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">CMAKE_<LANG>_FLAGS</span> and <span
        style="color: rgb(36, 41, 46); font-family: SFMono-Regular,
        Consolas, "Liberation Mono", Menlo, Courier,
        monospace; font-size: 11.9px; font-style: normal;
        font-variant-ligatures: normal; font-variant-caps: normal;
        font-weight: normal; letter-spacing: normal; orphans: 2;
        text-align: left; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgba(27, 31,
        35, 0.05); text-decoration-style: initial;
        text-decoration-color: initial; display: inline !important;
        float: none;">CMAKE_EXE_LINKER_FLAGS</span> when building an
      executable or a library respectively. However, to build a PIE <span
        style="color: rgb(36, 41, 46); font-family: SFMono-Regular,
        Consolas, "Liberation Mono", Menlo, Courier,
        monospace; font-size: 11.9px; font-style: normal;
        font-variant-ligatures: normal; font-variant-caps: normal;
        font-weight: normal; letter-spacing: normal; orphans: 2;
        text-align: start; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgba(27, 31,
        35, 0.05); text-decoration-style: initial;
        text-decoration-color: initial; display: inline !important;
        float: none;">-pie</span> linker flag is additionally required.
      Thus <span style="color: rgb(36, 41, 46); font-family:
        SFMono-Regular, Consolas, "Liberation Mono", Menlo,
        Courier, monospace; font-size: 11.9px; font-style: normal;
        font-variant-ligatures: normal; font-variant-caps: normal;
        font-weight: normal; letter-spacing: normal; orphans: 2;
        text-align: left; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgba(27, 31,
        35, 0.05); text-decoration-style: initial;
        text-decoration-color: initial; display: inline !important;
        float: none;">POSITION_INDEPENDENT_CODE</span> is not behaving
      as expected being a really easy to fix for someone aware with
      CMake codebase.</p>
    <p>Is there any reason why it wasn't added when the property was
      introduced? Somebody proposed introducing <span style="color:
        rgb(36, 41, 46); font-family: SFMono-Regular, Consolas,
        "Liberation Mono", Menlo, Courier, monospace;
        font-size: 11.9px; font-style: normal; font-variant-ligatures:
        normal; font-variant-caps: normal; font-weight: normal;
        letter-spacing: normal; orphans: 2; text-align: left;
        text-indent: 0px; text-transform: none; white-space: normal;
        widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgba(27, 31, 35, 0.05); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">POSITION_INDEPENDENT_EXECUTABLE</span>
      later on in addition to <span style="color: rgb(36, 41, 46);
        font-family: SFMono-Regular, Consolas, "Liberation
        Mono", Menlo, Courier, monospace; font-size: 11.9px;
        font-style: normal; font-variant-ligatures: normal;
        font-variant-caps: normal; font-weight: normal; letter-spacing:
        normal; orphans: 2; text-align: left; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 2;
        word-spacing: 0px; -webkit-text-stroke-width: 0px;
        background-color: rgba(27, 31, 35, 0.05); text-decoration-style:
        initial; text-decoration-color: initial; display: inline
        !important; float: none;">POSITION_INDEPENDENT_CODE</span> to
      maintain backwards compatibility (I suppose policies are also a
      solution?).</p>
    <p>This email is the result of the <a moz-do-not-send="true"
        href="https://github.com/arsenm/sanitizers-cmake/issues/13">thread</a>
      and the <a moz-do-not-send="true"
href="https://github.com/arsenm/sanitizers-cmake/issues/13#issuecomment-315532253">message</a>
      by Juan Navarro (big thanks to him), which fully summarizes
      CMake's <span style="color: rgb(36, 41, 46); font-family:
        SFMono-Regular, Consolas, "Liberation Mono", Menlo,
        Courier, monospace; font-size: 11.9px; font-style: normal;
        font-variant-ligatures: normal; font-variant-caps: normal;
        font-weight: normal; letter-spacing: normal; orphans: 2;
        text-align: left; text-indent: 0px; text-transform: none;
        white-space: normal; widows: 2; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgba(27, 31,
        35, 0.05); text-decoration-style: initial;
        text-decoration-color: initial; display: inline !important;
        float: none;">POSITION_INDEPENDENT_CODE</span> treatment and
      links to multiple bugs: <a
        href="https://cmake.org/Bug/view.php?id=14983">this one</a>, so
      far without attention, and <a moz-do-not-send="true"
        href="https://gitlab.kitware.com/cmake/cmake/issues/16382">this
        one</a>, resolved for Android.</p>
    <p>Thank you.</p>
    <p>Regards,<br>
      Oleksii Vilchanskyi<br>
    </p>
  </body>
</html>