How to stop MinGW and MSYS from mangling path names given at the command line

前端 未结 4 606
时光取名叫无心
时光取名叫无心 2020-11-28 22:50

On Windows, I\'m cross-compiling a program for ARM/Linux using CodeSourcery\'s cross-compiler suite. I use MinGW MSYS as my command interpreter, and very often it will mangl

4条回答
  •  一整个雨季
    2020-11-28 23:33

    I just discovered a neat trick to avoid MSYS/MinGW translating the paths for you.

    If you use double-slash to start the path, then MSYS won't translate the path to DOS format. So in OP's example, the -rpath switch should be specified like this:

    -Wl,-rpath=//usr/lib/myrpath

    All Unix/Linux tools seem to handle such spurious slashes without any problem, so even though your binary's rpath will start with //usr/... I think the loader will do the right thing.

提交回复
热议问题