cc65: ca65: .macpack doesn't look for files in cc65 share dir

ca65 -I common -o 01-implied.o 01-implied.a
common/macros.a:28: Error: Cannot open include file 'longbranch.mac': No such file or directory

the file is available in /share/cc65/asminc/longbranch.mac i.e. in one of cc65’s own directories.

strace from the above:

access("common/longbranch.mac", F_OK)   = -1 ENOENT (No such file or directory)
access("longbranch.mac", F_OK)          = -1 ENOENT (No such file or directory)
access("common/longbranch.mac", F_OK)   = -1 ENOENT (No such file or directory)
access("longbranch.mac", F_OK)          = -1 ENOENT (No such file or directory)
writev(2, [{"", 0}, {"common/macros.a:28: Error: Cannot open include file 'longbranch.mac': No such file or directory\n", 96}], 2common/macros.a:28: Error: Cannot open include file 'longbranch.mac': No such file or directory
) = 96

the expected behaviour is that the assembler always looks for files included via .macpack in it’s own include dir (if the above search in explicitly specified include dirs fails), much like e.g. gcc search for headers it ships inside its own directory tree, e.g. when you #include <xmmintrin.h>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 58 (47 by maintainers)

Commits related to this issue

Most upvoted comments

In src/Makefile:71, the build system determines if the suffix exe is to be used (

ifdef CMD_EXE
  EXE_SUFFIX=.exe
endif

ifdef CROSS_COMPILE
  EXE_SUFFIX=.exe
endif

Shouldn’t this be exactly the case(s) when Windows is built?

  • MSYS2 ifeq ($(shell uname -o),Msys)

We can not use uname (or COMSPEC) - we need to correctly detect a crosscompiler running on linux too. ie we must check what we are compiling for, not what we are compiling on

I wonder if there is a good way to test these things in a testcase…

anyhow, i’d like to fix this a bit cleaner and more throughout… like: a) remove extra slashes from pathes in the makefile so they dont even end up in those pathes b) escape the quotes in all those pathes, not just those you needed to make it work for you c) not remove the if expression for empty prefix, because this is actually needed for the intended “in tree” searching