Awk error when building tools on Mingw64

Frank Kühndel frank.kuehndel at embedded-brains.de
Thu Mar 17 17:14:49 UTC 2022


Hello Ryan,

I believe I have a different error than yours on a "Fedora Linux 35
Container" but my error is exactly at the same place as yours.

But to your problem:

It looks like the `$i` has been replaced nothing by substitution.
Compare the output:

At the top: `[...]match($i,\".*lpython.*\")[...]`
In the error message below: `[...]match(,".*lpython.*")[...]`

It looks like `awk` gets the command line without `$i`.

The problem is likely in file source-builder/config/gdb-common-1.cfg
line 111 and line 117. May I suggest to try to comment out line 117 and
118 with an `#` (or replace them somehow). Then the gdb should build.

The question is why the `$i` disappears? I have seen such things in
Makefiles. There, you would need to write `$$i` to prevent substitution.
Does "Mingw64" use an unusual `sh`? Maybe replacing all `sh` with a link
to `bash` solves this?

Greetings,
fk


On 3/17/22 15:55, Ryan Long wrote:
> Subject:
> Awk error when building tools on Mingw64
> From:
> Ryan Long <ral051 at oarcorp.com>
> Date:
> 3/17/22, 15:55
> 
> To:
> devel at rtems.org
> 
> 
> Hello,
> 
> I'm trying to build the Aarch64 tools on Mingw64. When building gdb, I
> am getting the following error.
> 
> config: tools/rtems-gdb-10.cfg
> error: shell macro failed: sh -c "/mingw64/bin/python2-config --ldflags
> | awk 'BEGIN{FS=\"
> \"}/python/{for(i=1;i<NF;++i)if(match($i,\".*lpython.*\")) print
> \"lib\"substr($i,3)\"*\";}'": 1: awk: cmd. line:1: BEGIN{FS="
> "}/python/{for(i=1;i<NF;++i)if(match(,".*lpython.*")) print
> "lib"substr(,3)"*";}
> awk: cmd. line:1: ^ syntax error
> awk: cmd. line:1: BEGIN{FS="
> "}/python/{for(i=1;i<NF;++i)if(match(,".*lpython.*")) print
> "lib"substr(,3)"*";}
> awk: cmd. line:1: ^ 1 is invalid as number of arguments for match
> 
> I made a file to store this command like so
> 
>   BEGIN {FS=" "}
> 
>   /python/ {
> for(i=1;i<NF;++i)
> if(match($i,".*lpython.*"))
>         print "lib"substr($i,3)"*"
>   }
> 
> and ran it with the command "python2-config --ldflags | awk -f
> test.awk". It produces "libpython2.7*" as the output. The only
> difference between the two is I took out the "\"s since it's not being
> run on the command line.
> 
> Does anyone have any ideas what might be going on? And how do we go
> about fixing this when the solution is found?
> 
> Thanks,
> 
> Ryan
> 
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

-- 
embedded brains GmbH
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehndel at embedded-brains.de
phone: +49-89-18 94 741 - 23
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list