This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help needed: File reading problems in gas?

On 08.06.2017 14:20, Nick Clifton wrote:
Hi Johann,

conftest.s: Assembler messages:
conftest.s: Error: can't open   for reading: No such file or directory

It works if

- remove the "&& ld..." part of ac_try
- the content of ac_try is executed directly (without eval)

Any ideas?

This appears to be a weird shell scripting problem.  The error message
is happening because gas is being passed a command line that includes a
single space as an argument.  I added this patch to as.c:

diff --git a/gas/as.c b/gas/as.c
index 83a572b..80a8a01 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1168,6 +1168,7 @@ perform_an_assembly_pass (int argc, char ** argv)
        {                       /* Is it a file-name argument?  */
          PROGRESS (1);
+         fprintf (stderr, "ARG %d ARGV %p *ARGV %s %d\n", argc + 1, argv, * argv, ** argv);
          /* argv->"" if stdin desired, else->filename.  */
          read_a_source_file (*argv);

and the output shows:

ARG 2 ARGV 0x122b8c8 *ARGV conftest.s 99
ARG 1 ARGV 0x122b8d0 *ARGV   32

So this is not an assembler problem.  Poor old gas is being asked to assemble a
non-existent file.


Thanks, I traced it back to the call of main, and it gets a " " as last argument... which is because of the \ in the ac_try... My bad

So I eventually ran something like "avr-as conftest.s \ ".

Sorry for the noise,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]