View Issue Details

IDProjectCategoryView StatusLast Update
0035744FPCCompilerpublic2019-07-31 15:41
ReporterSergey BychkowAssigned ToSven Barth 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.3.1Product Build 
Target VersionFixed in Version3.3.1 
Summary0035744: Windows compiler doesn't see simlink as an executable
DescriptionFPC can use external executable, for example, C:\lazarus\fpc\3.3.1\bin\i386-darwin\i386-darwin-ld.exe for cross-compilation only if this file is hard-linked or copied. It doesn't find it if this is NTFS simlink.

If file is copied or hard-linked then fpcdebuf.txt contains:
==
00008000:Searching file C:\lazarus\fpc\3.3.1\bin\i386-darwin\i386-darwin-ld.exe... found
00008000:(9017) Using util C:\lazarus\fpc\3.3.1\bin\i386-darwin\i386-darwin-ld.exe
==

However, if symlink was created instead, then
==
00008000:Searching file C:\lazarus\fpc\3.3.1\bin\i386-darwin\i386-darwin-ld.exe... not found
00008000:Searching file C:\lazarus\fpc\3.3.1\bin\x86_64-win64\i386-darwin-ld.exe... not found
...
10000002:Error: (9016) Util i386-darwin-ld.exe not found, switching to external linking
00008000:(9017) Using util i386-darwin-ld.exe
10000001:Fatal: (10026) There were 1 errors compiling module, stopping
10000001:Fatal: (1018) Compilation aborted
==
Steps To ReproduceMake sure that you have enough privileges for symlinks (run command prompt as Administrator), then:

> cd \lazarus\fpc\3.3.1\bin\i386-darwin
> mklink i386-darwin-ld.exe "C:\Program Files\LLVM\bin\ld64.lld.exe"
symbolic link created for i386-darwin-ld.exe <<===>> C:\Program Files\LLVM\bin\ld64.lld.exe
Additional InformationThis is an issue only for trunk/3.3.1.

Stable/3.0.4 doesn't have this issue.

May be it's also worth to accept *.bat and/or *.cmd files as external utility. They require different processing on Windows unlike *nixes where any script can be executable.
TagsNo tags attached.
Fixed in Revision42456
FPCOldBugId
FPCTarget-
Attached Files

Relationships

child of 0032370 resolvedSven Barth Windows. Compatibility with Delphi when working with links 

Activities

Anton Kavalenka

2019-06-21 18:30

reporter   ~0116821

0032370

Sergey Bychkow

2019-06-21 19:26

reporter   ~0116824

It looks like the problem is in new implementation of FileExists. It doesn't work with default parameter FollowLink = True

FileExists('test.exe') returns False if 'test.exe' is correct symlink to existing file project1.exe.

Quick fix is to write FileExists('test.exe', False{FileLink}) instead. But this will not compile with 3.0.4.

Anton Kavalenka

2019-06-25 16:49

reporter   ~0116926

Last edited: 2019-06-25 16:49

View 2 revisions

see the patch in https://bugs.freepascal.org/view.php?id=32370#c116925

Sven Barth

2019-07-19 17:55

manager   ~0117319

Please test and close if okay.

Issue History

Date Modified Username Field Change
2019-06-21 18:03 Sergey Bychkow New Issue
2019-06-21 18:30 Anton Kavalenka Note Added: 0116821
2019-06-21 19:26 Sergey Bychkow Note Added: 0116824
2019-06-25 16:49 Anton Kavalenka Note Added: 0116926
2019-06-25 16:49 Anton Kavalenka Note Edited: 0116926 View Revisions
2019-07-19 17:28 Sven Barth Relationship added child of 0032370
2019-07-19 17:55 Sven Barth Assigned To => Sven Barth
2019-07-19 17:55 Sven Barth Status new => resolved
2019-07-19 17:55 Sven Barth Resolution open => fixed
2019-07-19 17:55 Sven Barth Fixed in Version => 3.3.1
2019-07-19 17:55 Sven Barth Fixed in Revision => 42456
2019-07-19 17:55 Sven Barth FPCTarget => -
2019-07-19 17:55 Sven Barth Note Added: 0117319
2019-07-31 15:41 Sergey Bychkow Status resolved => closed