Forum
× CodeTyphon Cross-Build Development, discussions and problems

Question Cross compile smart linking issues on Win64 for RPI3

  • Sanogo
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 3 days ago #12946 by Sanogo

  • Hi, I installed CT 6.6 (latest stable version on Windows) and tried to cross compile a very simple sample project from Windows to RPI3 using FPC32.
    When I compile in Debug mode, everything works fine but when I try to compile in Release mode, compilation fails with a certain error message about linking.
    I narrowed down the issue to smartlinking when cross compiling from Win64 to RPI3 using the FPC32 compiler.
    If I disable smartlinking in Release mode, everything including linking works beautifully.
  • Please Log in or Create an account to join the conversation.

    • Sanogo
    • Topic Author
    • Offline
    • Fresh Boarder
    • Fresh Boarder
    More
    2 months 3 days ago #12949 by Sanogo
    Any help guys?

    Please Log in or Create an account to join the conversation.

    • Sternas Stefanos
    • Sternas Stefanos's Avatar
    • Away
    • Moderator
    • Moderator
    • Ex Pilot, M.Sc, Ph.D
    More
    2 months 2 days ago #12950 by Sternas Stefanos
    Replied by Sternas Stefanos on topic Cross compile smart linking issues on Win64 for RPI3
    Thanks Sir
    can you give us more info for you project ?

    CodeTyphon and UWS, Architect and Programmer

    Please Log in or Create an account to join the conversation.

    • Sanogo
    • Topic Author
    • Offline
    • Fresh Boarder
    • Fresh Boarder
    More
    2 months 2 days ago #12951 by Sanogo

    Sternas Stefanos wrote: Thanks Sir
    can you give us more info for you project ?


    Thanks for replying Sir, it's just a simple Lazarus Form Project. See it attached below
    Attachments:

    Please Log in or Create an account to join the conversation.

    • Sternas Stefanos
    • Sternas Stefanos's Avatar
    • Away
    • Moderator
    • Moderator
    • Ex Pilot, M.Sc, Ph.D
    More
    2 months 2 days ago - 2 months 2 days ago #12953 by Sternas Stefanos
    Replied by Sternas Stefanos on topic Cross compile smart linking issues on Win64 for RPI3
    Sir
    your project don't define arm-linux Platform more Info
    for Pi3 my suggestion is GTK2

    So, you build your project for Pi3 arm-linux but for Win32 Platform
    with all Debug, Release and Default modes of your project.

    CodeTyphon Form applications have TargetCPU, TargetOS and TargetPlatform

    CodeTyphon and UWS, Architect and Programmer
    Last edit: 2 months 2 days ago by Sternas Stefanos.

    Please Log in or Create an account to join the conversation.

    • Sanogo
    • Topic Author
    • Offline
    • Fresh Boarder
    • Fresh Boarder
    More
    2 months 2 days ago #12955 by Sanogo
    Hi, I followed your suggestions yet the problem remains, please do note that the project builds and links fine if I select debug mode or disable the "Link smart (-XX) option in Release mode, but if I enable "Link smart (-XX) option in any build mode, linking fails.
    I have repeated it over and over again.

    Please Log in or Create an account to join the conversation.

    • Sanogo
    • Topic Author
    • Offline
    • Fresh Boarder
    • Fresh Boarder
    More
    2 months 2 days ago #12956 by Sanogo

    Sternas Stefanos wrote: Sir
    your project don't define arm-linux Platform more Info
    for Pi3 my suggestion is GTK2

    So, you build your project for Pi3 arm-linux but for Win32 Platform
    with all Debug, Release and Default modes of your project.

    CodeTyphon Form applications have TargetCPU, TargetOS and TargetPlatform


    attached below is image proof.

    Attachments:

    Please Log in or Create an account to join the conversation.

    • Sternas Stefanos
    • Sternas Stefanos's Avatar
    • Away
    • Moderator
    • Moderator
    • Ex Pilot, M.Sc, Ph.D
    More
    2 months 2 days ago #12957 by Sternas Stefanos
    Replied by Sternas Stefanos on topic Cross compile smart linking issues on Win64 for RPI3
    So, you want "Smart Link" in a CrossBuild procedure ?

    CodeTyphon and UWS, Architect and Programmer

    Please Log in or Create an account to join the conversation.

    • Sanogo
    • Topic Author
    • Offline
    • Fresh Boarder
    • Fresh Boarder
    More
    2 months 2 days ago #12958 by Sanogo

    Sternas Stefanos wrote: So, you want "Smart Link" in a CrossBuild procedure ?


    Yes, is this not possible?
    Because it works for me if I try to smartlink when crossbuilding from Win32 to normal Linux (not ARM).

    Please Log in or Create an account to join the conversation.

    • Sternas Stefanos
    • Sternas Stefanos's Avatar
    • Away
    • Moderator
    • Moderator
    • Ex Pilot, M.Sc, Ph.D
    More
    2 months 2 days ago #12959 by Sternas Stefanos
    Replied by Sternas Stefanos on topic Cross compile smart linking issues on Win64 for RPI3
    OK, we will try fix this Sir

    CodeTyphon and UWS, Architect and Programmer
    The following user(s) said Thank You: Sanogo

    Please Log in or Create an account to join the conversation.

    More
    2 months 2 days ago - 2 months 2 days ago #12960 by fredvs
    Hello.

    Did you try to add this parameter at compilation:
    -k--gc-sections

    AFAIK, this parameter is omitted sometime with fpc if
    -XX
    is used.

    For example, if you compile libraries with
    -XX
    smart-linking will not work, you must use
    -k--gc-sections
    parameter to enable smart-linking.

    Fre;D
    Last edit: 2 months 2 days ago by fredvs.

    Please Log in or Create an account to join the conversation.

    • Sanogo
    • Topic Author
    • Offline
    • Fresh Boarder
    • Fresh Boarder
    More
    2 months 2 days ago #12961 by Sanogo

    fredvs wrote: Hello.

    Did you try to add this parameter at compilation:

    -k--gc-sections

    AFAIK, this parameter is omitted sometime with fpc if
    -XX
    is used.

    For example, if you compile libraries with
    -XX
    smart-linking will not work, you must use
    -k--gc-sections
    parameter to enable smart-linking.

    Fre;D


    Thanks for the help but unfortunately, it didn't work.

    Please Log in or Create an account to join the conversation.