Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-05-2025, 08:45 AM
|
#1
|
|
LQ Newbie
Registered: Aug 2025
Location: Central Europe
Posts: 4
Rep:
|
Problem resolving shortcuts (.lnk files) on cygwin
Hey,
I am trying to containerize an ancient, obscure CI/CD system and as part of this I want to set up cygwin inside a Windows Server 2025 Core container.
The problem I am facing is that the MontaVista compiler from 2006 uses several .lnk files (shortcuts) as a replacement for symbolic links. While cygwin on the existing CI/CD server (from 2010, I suppose) is able to resolve the .lnk files to their executables, for instance, gcc.exe.lnk can be called using just gcc, the new installation is not able to resolve the shortcuts anymore.
For instance, on the existing system the command /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc resolves the shortcut .../fp_be/mips-hardhat-linux/bin/gcc correctly to .../fp_be/bin/mips_fp_be-gcc, as shown below:
$ /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc --version
mips_fp_be-gcc (GCC) 3.3.1 (MontaVista 3.3.1-7.0.42.0600552 2006-04-30)
Copyright (C) 2003 Free Software Foundation, Inc.
Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es
gibt KEINE Garantie; auch nicht f"ur VERKAUFBARKEIT oder F"UR SPEZIELLE ZWECKE.
However, the modern cygwin installation can not resolve the shortcut /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc.exe.lnk as the older installation, as shown below:
$ /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc.exe.lnk
/bin/sh: line 1: /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc.exe.lnk: cannot execute binary file: Exec format error
Below is the content of the file /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc.exe.lnk:
$ cat /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc.exe.lnk
L?F
../../bin/mips_fp_be-gcc.exe..\..\bin\mips_fp_be-gcc.exe
How can I make sure that the shortcuts stored inside the .lnk files are restored as on the existing CI/CD server? Could it be a problem with the locale, as the current system is set to German and the shortcuts were created by an old MontaVista compiler installation? Is there a more suited program than cat for inspecting Windows shortcuts?
Thank you so much for your help!
|
|
|
|
08-05-2025, 08:52 AM
|
#2
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460
|
|
|
|
|
08-05-2025, 09:08 AM
|
#3
|
|
LQ Newbie
Registered: Aug 2025
Location: Central Europe
Posts: 4
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
|
Thank you for the tip, I had tried earlier and I had received the following error:
$ cygstart /cygdrive/d/MontaVista/opt/montavista/pro/devkit/mips/fp_be/mips-hardhat-linux/bin/gcc.exe.lnk --version
Unable to start 'D:\MontaVista\opt\montavista\pro\devkit\mips\fp_be\mips-hardhat-linux\bin\gcc.exe.lnk': There is no application associated with the given file name extension.
I just tried again and I received the same error.
|
|
|
|
08-05-2025, 09:55 AM
|
#4
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460
|
sorry, I have no cygwin, no lnk files, but I guess you can use cygstart to run cmd and start lnk inside. (or at least something similar should work).
|
|
|
|
08-06-2025, 09:01 AM
|
#5
|
|
Member
Registered: Jun 2025
Distribution: Slackware64 Current
Posts: 227
Rep:
|
Is a virtual machine an option?
|
|
|
|
08-06-2025, 11:21 AM
|
#6
|
|
Senior Member
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi, Debian, antiX, Ubuntu
Posts: 2,326
|
or WSL....
|
|
|
|
08-06-2025, 11:57 AM
|
#7
|
|
Senior Member
Registered: Jul 2020
Posts: 1,880
|
Quote:
Originally Posted by ledesma_verde
MontaVista compiler from 2006
|
Is it a 32-bit compiler by any chance? And you new installation is, of course, 64-bit because cygwin dropped 32-bit support quite some time ago.
|
|
|
|
08-07-2025, 02:01 AM
|
#8
|
|
LQ Newbie
Registered: Aug 2025
Location: Central Europe
Posts: 4
Original Poster
Rep:
|
Okay, I was able to solve the problem. It turned out that cygwin shortcut resolution has changed over time and the shortcuts created by MontaVista in 2006 can not be resolved using the current cygwin version 3.6.4-1. However, I was able to use the cygwin time machine to download cygwin version 2.10.0-1. Using this version, the shortcut resolution worked on my corporate M$ machine.
However, when working with Windows containers there were several issues with the file attributes missing due to the file system being used by docker. I initially tried to unzip the ZIP archive into the container file system during the build phase so that the container would start as fast as possible and be self-contained. However, the shortcut resolution did not work due to issues with the file attributes. Thus, as a fix given that the container is an intermediate solution while modernising the build process, I decided to mount the unzipped directory containing the compiler using docker's -v option: docker run --rm --name mips-build -v C:\xyz\resources\MontaVista:C:\MontaVista mips-build:0.0.0.
However, the compiler needs to be located inside the "D: drive". Thus, I created a symbolic link as part of the CMD instruction within the Docker file:
CMD [ "C:\\cygwin64\\bin\\bash.exe", "--login", "-i", "-c", "ln -s /cygdrive/c/montavista/ /cygdrive/d/MontaVista", "&&", "..." ]
These measures fixed the issues with the build. I am leaving this up in case anyone struggles with issues like that later.
Thanks everybody for the help! 
Last edited by ledesma_verde; 08-07-2025 at 02:23 AM.
|
|
|
|
All times are GMT -5. The time now is 06:09 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|