LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 08-05-2025, 08:45 AM   #1
ledesma_verde
LQ Newbie
 
Registered: Aug 2025
Location: Central Europe
Posts: 4

Rep: Reputation: 0
Question 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!
 
Old 08-05-2025, 08:52 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460

Rep: Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608
see here: https://superuser.com/questions/7901...tcut-files-lnk
 
Old 08-05-2025, 09:08 AM   #3
ledesma_verde
LQ Newbie
 
Registered: Aug 2025
Location: Central Europe
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
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.
 
Old 08-05-2025, 09:55 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460

Rep: Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608Reputation: 8608
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).
 
Old 08-06-2025, 09:01 AM   #5
clueless_dolt
Member
 
Registered: Jun 2025
Distribution: Slackware64 Current
Posts: 227

Rep: Reputation: 67
Is a virtual machine an option?
 
Old 08-06-2025, 11:21 AM   #6
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi, Debian, antiX, Ubuntu
Posts: 2,326

Rep: Reputation: 829Reputation: 829Reputation: 829Reputation: 829Reputation: 829Reputation: 829Reputation: 829
or WSL....
 
Old 08-06-2025, 11:57 AM   #7
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,880

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
Quote:
Originally Posted by ledesma_verde View Post
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.
 
Old 08-07-2025, 02:01 AM   #8
ledesma_verde
LQ Newbie
 
Registered: Aug 2025
Location: Central Europe
Posts: 4

Original Poster
Rep: Reputation: 0
Talking

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.
 
  


Reply

Tags
cygwin, windows



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set the path in idesk lnk file user1099 Linux - Newbie 2 01-25-2023 03:28 PM
[SOLVED] How to open .lnk file in Linux? hack3rcon Linux - Software 10 07-03-2020 06:58 PM
script to read lnk files on file shares with Linux file managers RaceQuest Linux - General 2 02-08-2018 10:43 AM
Opening a .lnk file in OpenOffice 2 beta jilai Linux - Software 2 04-10-2006 09:56 PM
Cannot copy file 31/2 Floppy(A).lnk u4113072 Linux - Software 0 12-07-2002 01:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:09 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions