Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #68851 > unrolled thread

How to debug this make error?

Started byfl <rxjwg98@gmail.com>
First post2015-09-01 06:46 -0700
Last post2015-09-01 11:17 -0700
Articles 11 — 7 participants

Back to article view | Back to comp.lang.c


Contents

  How to debug this make error? fl <rxjwg98@gmail.com> - 2015-09-01 06:46 -0700
    Re: How to debug this make error? fl <rxjwg98@gmail.com> - 2015-09-01 07:32 -0700
      Re: How to debug this make error? Clark Smith <noaddress@nowhere.net> - 2015-09-01 14:40 +0000
        Re: How to debug this make error? jt@toerring.de (Jens Thoms Toerring) - 2015-09-01 15:46 +0000
      Re: How to debug this make error? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-01 09:37 -0700
        Re: How to debug this make error? jt@toerring.de (Jens Thoms Toerring) - 2015-09-01 17:08 +0000
    Re: How to debug this make error? fl <rxjwg98@gmail.com> - 2015-09-01 08:58 -0700
      Re: How to debug this make error? gordonb.uddfm@burditt.org (Gordon Burditt) - 2015-09-02 00:44 -0500
    Re: How to debug this make error? Keith Thompson <kst-u@mib.org> - 2015-09-01 09:23 -0700
    Re: How to debug this make error? Lőrinczy Zsigmond <zsiga@nospam.for.me> - 2015-09-01 18:44 +0200
    Re: How to debug this make error? fl <rxjwg98@gmail.com> - 2015-09-01 11:17 -0700

#68851 — How to debug this make error?

Fromfl <rxjwg98@gmail.com>
Date2015-09-01 06:46 -0700
SubjectHow to debug this make error?
Message-ID<3a1bd0dc-f81d-4027-8331-e05847bd6513@googlegroups.com>
Hi,

I have a C project having cmake. The generated Makefile can generate an error
when run make, see below please.

The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue for me to find the bug. Could you help me?



..............................
u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
[  0%] Generating math/arch/arm/flib-mathi32-arm.s
/bin/sh: 1: ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
make: *** [all] Error 2

[toc] | [next] | [standalone]


#68858

Fromfl <rxjwg98@gmail.com>
Date2015-09-01 07:32 -0700
Message-ID<c535e3dd-f6ca-4020-9dce-f943e4fe3c6f@googlegroups.com>
In reply to#68851
On Tuesday, September 1, 2015 at 9:47:10 AM UTC-4, fl wrote:
> Hi,
> 
> I have a C project having cmake. The generated Makefile can generate an error
> when run make, see below please.
> 
> The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue for me to find the bug. Could you help me?
> 
> 
> 
> ..............................
> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
> [  0%] Generating math/arch/arm/flib-mathi32-arm.s
> /bin/sh: 1: ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
> make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
> make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make: *** [all] Error 2

Excuse me, the above message should be:
..............................
u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
[  0%] Generating math/arch/arm/flib-mathi32-arm.s
/bin/sh: 1: ../../../common-flib/src/math/arch/arm/flib-mathi32-arm.s: Permission denied
make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
make: *** [all] Error 2 
.........
It is really puzzling why it needs permission.
The computer is a Ubuntu Linux, 32-bit. The project is a cross-compiling to ARM.
Thanks,

[toc] | [prev] | [next] | [standalone]


#68861

FromClark Smith <noaddress@nowhere.net>
Date2015-09-01 14:40 +0000
Message-ID<ms4dde$ekn$1@news.albasani.net>
In reply to#68858
On Tue, 01 Sep 2015 07:32:04 -0700, fl wrote:

> On Tuesday, September 1, 2015 at 9:47:10 AM UTC-4, fl wrote:
>> Hi,
>> 
>> I have a C project having cmake. The generated Makefile can generate an
>> error when run make, see below please.
>> 
>> The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue
>> for me to find the bug. Could you help me?
>> 
>> 
>> 
>> ..............................
>> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make [  0%] Generating
>> math/arch/arm/flib-mathi32-arm.s /bin/sh: 1:
>> ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
>> make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error
>> 126 make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
>> make: *** [all] Error 2
> 
> Excuse me, the above message should be:
> ..............................
> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make [  0%] Generating
> math/arch/arm/flib-mathi32-arm.s /bin/sh: 1:
> ../../../common-flib/src/math/arch/arm/flib-mathi32-arm.s: Permission
> denied make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s]
> Error 126 make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make: *** [all] Error 2 .........
> It is really puzzling why it needs permission.
> The computer is a Ubuntu Linux, 32-bit. The project is a cross-compiling
> to ARM. Thanks,

	What I find puzzling is why is the makefile trying to execute 
what seems to be an assembly language source file. Since it is generated 
by the makefile, it would seem that the expectation is to create an 
executable from this file, and then execute it.

[toc] | [prev] | [next] | [standalone]


#68870

Fromjt@toerring.de (Jens Thoms Toerring)
Date2015-09-01 15:46 +0000
Message-ID<d4lvhtFs8b0U1@mid.uni-berlin.de>
In reply to#68861
Clark Smith <noaddress@nowhere.net> wrote:
> On Tue, 01 Sep 2015 07:32:04 -0700, fl wrote:
> > On Tuesday, September 1, 2015 at 9:47:10 AM UTC-4, fl wrote:
> > Excuse me, the above message should be:
> > ..............................
> > u6j@u6j-7696:~/20134-Floating/sd-src/build$ make [  0%] Generating
> > math/arch/arm/flib-mathi32-arm.s /bin/sh: 1:
> > ../../../common-flib/src/math/arch/arm/flib-mathi32-arm.s: Permission
> > denied make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s]
> > Error 126 make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> > make: *** [all] Error 2 .........
> > It is really puzzling why it needs permission.
> > The computer is a Ubuntu Linux, 32-bit. The project is a cross-compiling
> > to ARM. Thanks,

>         What I find puzzling is why is the makefile trying to execute 
> what seems to be an assembly language source file. Since it is generated 
> by the makefile, it would seem that the expectation is to create an 
> executable from this file, and then execute it.

Without more information it's impossible to know what's happening
there. It might also be possible that creating the '.s' file fails
because of missing permissions to write to the target directory.
I've read somewhere that starting make with

   make VERBOSE=1

may increase the amout of information output considerably - perhaps
that would give a clearer picture. But the OP should really consider
asking that kind of questions in a group or forum that actually is
about cmake, comp.lang.c is definitely not the place to look for
information about tools that might be used in compiling code.

                               Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de

[toc] | [prev] | [next] | [standalone]


#68879

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2015-09-01 09:37 -0700
Message-ID<10954e1b-744f-45cc-abac-95353fa5ae04@googlegroups.com>
In reply to#68858
On Tuesday, September 1, 2015 at 3:32:15 PM UTC+1, fl wrote:
> On Tuesday, September 1, 2015 at 9:47:10 AM UTC-4, fl wrote:
> > Hi,
> > 
> > I have a C project having cmake. The generated Makefile can generate an error
> > when run make, see below please.
> > 
> > The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue for me to find the bug. Could you help me?
> > 
> > 
> > 
> > ..............................
> > u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
> > [  0%] Generating math/arch/arm/flib-mathi32-arm.s
> > /bin/sh: 1: ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
> > make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
> > make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> > make: *** [all] Error 2
> 
> Excuse me, the above message should be:
> ..............................
> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
> [  0%] Generating math/arch/arm/flib-mathi32-arm.s
> /bin/sh: 1: ../../../common-flib/src/math/arch/arm/flib-mathi32-arm.s: Permission denied
> make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
> make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make: *** [all] Error 2 
> .........
> It is really puzzling why it needs permission.
> The computer is a Ubuntu Linux, 32-bit. The project is a cross-compiling to ARM.
> Thanks,
>
Very odd.
It looks like the makefile is generating an assembly file on the fly, then calling the
shell interpreter on it. Naturally there shell interpreter refuses to execute the
script.
However makefiles are very difficult to correct. It's unlikely to be coding the invocation
of sh in any obvious way, and it's not clear what it really wants to achieve.

[toc] | [prev] | [next] | [standalone]


#68884

Fromjt@toerring.de (Jens Thoms Toerring)
Date2015-09-01 17:08 +0000
Message-ID<d4m4ceFs8b0U3@mid.uni-berlin.de>
In reply to#68879
Malcolm McLean <malcolm.mclean5@btinternet.com> wrote:
> Very odd.
> It looks like the makefile is generating an assembly file on the fly, then
> calling the shell interpreter on it. Naturally there shell interpreter
> refuses to execute the script.
> However makefiles are very difficult to correct. It's unlikely to be coding
> the invocation of sh in any obvious way, and it's not clear what it really
> wants to achieve.

That Makefile obviously was created by cmake, so it's the
input files for cmake that should be looked at, not the
resulting Makefile. And one not so uncommon mistake new
users of cmake tend to make is trying to run cmake and
build in the source directory, even though this strongly
discouraged. This can have really weird results...

                             Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de

[toc] | [prev] | [next] | [standalone]


#68874

Fromfl <rxjwg98@gmail.com>
Date2015-09-01 08:58 -0700
Message-ID<6943a8d8-4f60-4c0d-bc86-871a1e259b68@googlegroups.com>
In reply to#68851
On Tuesday, September 1, 2015 at 9:47:10 AM UTC-4, fl wrote:
> Hi,
> 
> I have a C project having cmake. The generated Makefile can generate an error
> when run make, see below please.
> 
> The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue for me to find the bug. Could you help me?
> 
> 
> 
> ..............................
> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
> [  0%] Generating math/arch/arm/flib-mathi32-arm.s
> /bin/sh: 1: ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
> make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
> make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make: *** [all] Error 2

Thanks. I have subscribed cmake maillist, but never receive a activating email.

Excuse me I have to ask question here.

I have turn on VERBOSE in the following make.
Can you see any suspicious thing? 

Thanks,

.......
> make VERBOSE=1 
/usr/bin/cmake -H/home/uj/DFloating/s2src -B/home/uj/DFixed --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/uj/DFixed/CMakeFiles /home/uj/DFixed/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/uj/DFixed'
make -f common-flib/src/CMakeFiles/flib.dir/build.make common-flib/src/CMakeFiles/flib.dir/depend
make[2]: Entering directory `/home/uj/DFixed'
/usr/bin/cmake -E cmake_progress_report /home/uj/DFixed/CMakeFiles 
[  0%] Generating math/arch/arm/flib-math-i32-arm.s
cd /home/uj/DFixed/common-flib/src && /home/uj/DFloating/s2src/common-flib/src/math/arch/arm/flib-math-i32-arm.s /home/uj/DFixed/common-flib/src/math/arch/arm/flib-math-i32-arm.s
/bin/sh: 1: /home/uj/DFloating/s2src/common-flib/src/math/arch/arm/flib-math-i32-arm.s: Permission denied
make[2]: *** [common-flib/src/math/arch/arm/flib-math-i32-arm.s] Error 126
make[2]: Leaving directory `/home/uj/DFixed'
make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
make[1]: Leaving directory `/home/uj/DFixed'
make: *** [all] Error 2
[linux-devkit]:~/DFixed> ls -ld /home/uj/DFixed/s2src/common-flib/src/math/arch/arm
drwxrwxr-x 2 uj uj 4096 Sep  1 11:40 /home/uj/DFixed/s2src/common-flib/src/math/arch/arm

[toc] | [prev] | [next] | [standalone]


#68956

Fromgordonb.uddfm@burditt.org (Gordon Burditt)
Date2015-09-02 00:44 -0500
Message-ID<edSdnbdq_r9HEXvInZ2dnUU7-YmdnZ2d@posted.internetamerica>
In reply to#68874
> I have turn on VERBOSE in the following make.
> Can you see any suspicious thing? 

One thing suspicious is that the Makefile wasn't provided in the
original post.  Another is that make errors are off-topic in
comp.lang.c .

...
> [  0%] Generating math/arch/arm/flib-math-i32-arm.s
> cd /home/uj/DFixed/common-flib/src && /home/uj/DFloating/s2src/common-flib/src/math/arch/arm/flib-math-i32-arm.s /home/uj/DFixed/common-flib/src/math/arch/arm/flib-math-i32-arm.s

Ok, here's the command that failed (above).  It's obvious that the command
is missing after the && and it's trying to execute a source file, hence
you get an accurate but very misleading complaint about file permissions.
Some variable has expanded to a 0-length string when it shouldn't.

The command as written in the Makefile is probably something like this:

	cd $(FUNKY_SUB_DIRECTORY); $(FUNKY_CODE_GENERATOR) $(FUNKY_FILE_ONE) $(FUNKY_FILE_TWO)

where FUNKY_CODE_GENERATOR is an undefined variable that shouldn't
be undefined.  Since the line above it says Generating ... *.s,
it's some command that generates an assembler input file, or possibly
a copy command, copy-if-newer command, copy-if-different or a
preprocessor for assembly-language files.  It may or may not need
option flags.

Find the undefined variable and define it correctly.  It appears
directly after && in a command line, although it might come from
system-default patterns and be harder to find.

The variable names I used above are examples only, and I'm pretty
sure they don't match the ones actually used.

The cmake --warn-unitialized flag is supposed to warn you when an
uninitialized variable is used.  This may, however, lots of trigger
non-useful warnings on a whole bunch of optional things that can
go on a command line, such as those for compiler flags, debug flags,
extra libraries, etc.


> /bin/sh: 1: /home/uj/DFloating/s2src/common-flib/src/math/arch/arm/flib-math-i32-arm.s: Permission denied
> make[2]: *** [common-flib/src/math/arch/arm/flib-math-i32-arm.s] Error 126
> make[2]: Leaving directory `/home/uj/DFixed'
> make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make[1]: Leaving directory `/home/uj/DFixed'
> make: *** [all] Error 2
> [linux-devkit]:~/DFixed> ls -ld /home/uj/DFixed/s2src/common-flib/src/math/arch/arm
> drwxrwxr-x 2 uj uj 4096 Sep  1 11:40 /home/uj/DFixed/s2src/common-flib/src/math/arch/arm

[toc] | [prev] | [next] | [standalone]


#68877

FromKeith Thompson <kst-u@mib.org>
Date2015-09-01 09:23 -0700
Message-ID<lnr3mirtur.fsf@kst-u.example.com>
In reply to#68851
fl <rxjwg98@gmail.com> writes:
> I have a C project having cmake. The generated Makefile can generate an error
> when run make, see below please.
>
> The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue for me to find the bug. Could you help me?
>
>
>
> ..............................
> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
> [  0%] Generating math/arch/arm/flib-mathi32-arm.s
> /bin/sh: 1: ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
> make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
> make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make: *** [all] Error 2

This does not appear to be a C question.  You might try asking in
comp.unix.programmer.

If you do, they're probably going to need more information than you've
provided, at least the input to cmake.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#68881

FromLőrinczy Zsigmond <zsiga@nospam.for.me>
Date2015-09-01 18:44 +0200
Message-ID<ms4kl2$uig$1@speranza.aioe.org>
In reply to#68851
Off:

> The program runs on Ubuntu Linux 14.04, 32-bit.
It is rather no clue for me to find the bug.

Some Makefiles are meant to be hard-to-debug,
eg. every command in them begins with an @atsymbol.

Don't hesitate to fix them:
sed 's/^<tab>@/<tab>/' Makefile >Makefile.test

[toc] | [prev] | [next] | [standalone]


#68895

Fromfl <rxjwg98@gmail.com>
Date2015-09-01 11:17 -0700
Message-ID<d927fe17-eb1c-42ee-aee7-6d8015eda1b1@googlegroups.com>
In reply to#68851
On Tuesday, September 1, 2015 at 9:47:10 AM UTC-4, fl wrote:
> Hi,
> 
> I have a C project having cmake. The generated Makefile can generate an error
> when run make, see below please.
> 
> The program runs on Ubuntu Linux 14.04, 32-bit. It is rather no clue for me to find the bug. Could you help me?
> 
> 
> 
> ..............................
> u6j@u6j-7696:~/20134-Floating/sd-src/build$ make
> [  0%] Generating math/arch/arm/flib-mathi32-arm.s
> /bin/sh: 1: ../../../common-flib/src/math/arch/arm/mathi32-arm.s: Permission denied
> make[2]: *** [common-flib/src/math/arch/arm/flib-mathi32-arm.s] Error 126
> make[1]: *** [common-flib/src/CMakeFiles/flib.dir/all] Error 2
> make: *** [all] Error 2
The cmake configuration file has such settings, especially I am interested in
assembler setting. After check cmake website, I don't find an environment
variable on assembler. Thus, even though below is not correct, I don't know
how to correct it.

............
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_ASSEMBLER $ENV{HOME}/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-as)
SET(CMAKE_C_COMPILER $ENV{HOME}/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER $ENV{HOME}/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH $ENV{HOME}/ti-processor-sdk-linux-am335x-evm-01.00.00.03/bin/rootfs)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
///////////////

Below is cmake command and its screen echo message.
It uses arm-linux-gnueabihf-gcc as the assembler.

..........
$ cmake -DBUILD=LINUX-ARMv7a -DCFG=Debug -DMATH=F32 -DCMAKE_TOOLCHAIN_FILE=$HOME/DFixed/arm_sitara.cmake $HOME/DFixed/s2src
-- CMAKE SCRIPTS VERSION 1.1.1.0
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- Check for working C compiler: /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The ASM compiler identification is GNU
-- Found assembler: /home/uj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc
-- Configuring done
-- Generating done
/////////////////////////


When I run below validation line for arm-linux-gnueabihf-gcc. It is found it
cannot assemble the .s file.
............................
arm-linux-gnueabihf-gcc s2src/common-flib/src/math/arch/arm/flib-math-i32-arm.s
s2src/common-flib/src/math/arch/arm/flib-math-i32-arm.s: Assembler messages:
////////////////////////

Thus, I suspect the assembler is not set correct, but I don't know how to set
it. 
CMAKE website on the variable is as below:


http://www.cmake.org/Wiki/CMake_Useful_Variables



Anyone can help on this problem?

Thanks,

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.c


csiph-web