Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust absolute linker paths to use directory #10

Open
GitMensch opened this issue Oct 8, 2021 · 1 comment · May be fixed by #11
Open

Adjust absolute linker paths to use directory #10

GitMensch opened this issue Oct 8, 2021 · 1 comment · May be fixed by #11

Comments

@GitMensch
Copy link
Contributor

link error with

cccl -o conftest.exe -I/d/dev/includes -L/d/dev/libs mconftest.c -lmpir --cccl-verbose

works with

cccl -o conftest.exe -I/d/dev/includes -Ld:/dev/libs mconftest.c -lmpir --cccl-verbose

It looks like link.exe does not like /d/ while the C preprocessor has no issues with that. Possibly paths starting with / could be adjusted; it should be quite save to changed /X/ to X:/ when X is a single letter.

GitMensch added a commit to GitMensch/cccl that referenced this issue Oct 8, 2021
@GitMensch GitMensch linked a pull request Oct 10, 2021 that will close this issue
@wsfulton
Copy link
Member

it should be quite save to changed /X/ to X:/ when X is a single letter.

Not safe and too hacky IMHO. This approach makes too many presumptions about the file system emulation in the Unix space. cccl is not the right tool to manipulate file names and so won't accept patches to manipulate them.

The correct way is to use the appropriate file manipulation tools (cygpath on mingw/msys/cygwin) or inbuilt path translations in MinGW/MSYS, see https://web.archive.org/web/20201112005258/http://www.mingw.org/wiki/Posix_path_conversion (Wayback machine snapshot of mingw.org is the best I could find). Assuming you are using a mingw based system, I think this is also a bug there as it should adjust file paths when invoking a win32 executable. Or perhaps you have set MSYS_NO_PATHCONV by mistake?

Lastly, the example you gave works for me using MSYS2 and cl.exe finds the library to link with when using a -L with a full path as you've shown using slashes. It would be interesting to see the translated paths that MinGW/MSYS actually pass to cl.exe. Try use one of the sysinternal tools??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants