Unable to build ML with Cygwin 32

Started by Meloware, March 05, 2017, 01:33:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Meloware

I have been all day on this, as well as annoying dfort, and still without progress. I am unable to install Cygwin, etc., according to dfort's post http://www.magiclantern.fm/forum/index.php?topic=15894.0 and successfully build ML.

My system is Windows 7 Pro (I7 24GB ram). All of the files I needed were downloaded today. I have followed dfort's instructions for a 32 bit install, copying and pasting all the command line examples he has provided. All appeared to proceed normally, and I presume the install was properly finished once the unified version was cloned out of https://bitbucket.org/hudson/magic-lantern was done.

Desiring a build for the EOS M, I went to \home\chris\magic-lantern\platform\EOSM.202, with my Cygwin 32 terminal, and typed:
make zip

Dfort tried the same procedure today, and made a successful build. He then emailed me the console report of the build process.

My experience was identical, until after a bit after the message 
make[1]: Leaving directory '/home/chris/magic-lantern/tcc
was generated. Trouble seems to begin at the line:
[ LD       ]   magiclantern

Below is my printout following the exit from the tcc directory. Everything prior to the following lines were essentially identical to dfort's successful build. Notice that none of the symbols defined within tcc seem to be understood. HELP! I have attempted a fresh install twice and still get the same error. I am ready to be shamed for doing something dumb, if someone is willing to show a path to success.

make[1]: Leaving directory '/home/chris/magic-lantern/tcc'
[ CC       ]   module.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ CP       ]   newlib-libm.a
[ CP       ]   gcc-libgcc.a
[ LD       ]   magiclantern
module.o: In function `module_load_symbols.constprop.2':
module.c:(.text+0xebc): undefined reference to `tcc_add_symbol'
module.o: In function `_module_load_all':
module.c:(.text+0xf2c): undefined reference to `tcc_new'
module.c:(.text+0xf38): undefined reference to `tcc_set_options'
module.c:(.text+0xf5c): undefined reference to `tcc_delete'
module.c:(.text+0xf98): undefined reference to `tcc_delete'
module.c:(.text+0x11b4): undefined reference to `tcc_delete'
module.c:(.text+0x11f0): undefined reference to `tcc_add_file'
module.c:(.text+0x1250): undefined reference to `tcc_relocate'
module.c:(.text+0x127c): undefined reference to `tcc_relocate'
module.c:(.text+0x12e4): undefined reference to `tcc_delete'
module.c:(.text+0x1350): undefined reference to `tcc_get_symbol'
module.c:(.text+0x1378): undefined reference to `tcc_get_symbol'
module.c:(.text+0x13a0): undefined reference to `tcc_get_symbol'
module.c:(.text+0x13c8): undefined reference to `tcc_get_symbol'
module.c:(.text+0x13f0): undefined reference to `tcc_get_symbol'
module.o:module.c:(.text+0x16e0): more undefined references to `tcc_get_symbol' follow
module.o: In function `_module_load_all':
module.c:(.text+0x1740): undefined reference to `tcc_delete'
module.o: In function `module_load_task':
module.c:(.text+0x1a0c): undefined reference to `tcc_load_offline_section'
module.o: In function `module_load':
module.c:(.text+0x1ad0): undefined reference to `tcc_new'
module.c:(.text+0x1adc): undefined reference to `tcc_set_options'
module.c:(.text+0x1b00): undefined reference to `tcc_delete'
module.c:(.text+0x1b14): undefined reference to `tcc_add_file'
module.c:(.text+0x1b28): undefined reference to `tcc_relocate'
module.c:(.text+0x1b38): undefined reference to `tcc_delete'
module.o: In function `module_get_symbol':
module.c:(.text+0x1b58): undefined reference to `tcc_get_symbol'
module.o: In function `module_exec':
module.c:(.text+0x1b80): undefined reference to `tcc_get_symbol'
module.o: In function `module_unload':
module.c:(.text+0x1cfc): undefined reference to `tcc_delete'
make: *** [../../src/Makefile.src:195: magiclantern] Error 1

chris@melo2 ~/magic-lantern/platform/EOSM.202
$

dfort

First thing, it would be better to post on the Cygwin tutorial instead of starting a new topic. That way all the issues people are having with Cygwin would be in one place.

I noticed that one of my commands is a bit long, though I just tested it and it works fine:

cd && wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip && mkdir gcc-arm-none-eabi-4_8-2013q4 && unzip -n gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip -d gcc-arm-none-eabi-4_8-2013q4 && rm gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip

If it didn't complete successfully you won't have the ARM compiler set up properly. That's what your error looks like to me, though I may be wrong on this.

Try deleting the gcc-arm-none-eabi-4_8-2013q4 and do it a step at a time.

Note that you can also do this the "normal" Windows way using your browser and an Explorer window but if you want to get some command line practice--make sure you are using the Cygwin terminal and not the Windows cmd.exe app.

First doing a simple cd will get you into your home directory.
cd

The wget command is rather long so make sure you got copy/paste down.
wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip

Next make a directory with the name that ML has in Makefile.user.default:
mkdir gcc-arm-none-eabi-4_8-2013q4

Unzip the archive into this directory:
unzip -n gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip -d gcc-arm-none-eabi-4_8-2013q4

Finally, you don't really need to keep the zip file around so we can get rid of it:
rm gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip

Did that work?

[EDIT] Another thought--are you doing a "make clean" and re-trying? It is best to do "make clean" from the main "magic-lantern" directory so all the directories are cleaned out. Then cd back into the platform you want to compile and try again.

Meloware

I see the same problem, after following these specific instructions.

I did check the version of gcc, which was installed by the instructions in your main post, with the command: gcc --version

It reported that I have gcc version 5.4.0, and not 4.8.3 as seems to be what is recommended. Could this be the trouble?

dfort

I don't think that's the problem. I'm running gcc 5.4.0 on my Mac without any issues.

The problem seems to be in building and linking the Tiny C Compiler. Probably something obvious but I can't see it.

I can make an attempt at sending you my entire cygwin environment but that is going to take a while on my old PC. Even with that, I'm not sure it will work. I'll post a link when it is ready to download.

dfort


Meloware

Interesting. There is a different report of error messages, but it seems to fail in the same place. Below is the output just before the trouble starts. In both cases, the build fails after the script checks tcc. With the entire cygwin directory replaced, it is a challenge think of where else to look.
Was this zipfile made on a Mac? Every file in the zip was considered encrypted on Windows 7. It took three hours for Explorer to change all the attributes and allow it to run. This "encryption fix" works much faster with 7z, but I needed to try both to see if the error was identical.
I also tried to make a build for the 650D and 700D cameras, and they also failed at the same point.

I am now able to compile ML after installing an Oracle VM Virtual Linux Box. Unless other people have this problem, it may not be worth spending effort solving. Still, I wish I knew why this didn't work. There is still no certainty that this current failure is related to the problem I had to start with.

make[1]: Entering directory '/home/chris/magic-lantern/tcc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/chris/magic-lantern/tcc'
[ CC       ]   module.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ CP       ]   newlib-libm.a
[ CP       ]   gcc-libgcc.a
[ LD       ]   magiclantern
[ SYMBOLS  ]   magiclantern.sym
/bin/sh: /usr/bin/awk: cannot execute binary file: Exec format error
[ CP       ]   EOSM_202.sym
[ CP       ]   install
[ VERSION  ]   ../../platform/EOSM.202/version.bin
/usr/bin/hg: line 10: import: command not found
/usr/bin/hg: line 11: import: command not found
/usr/bin/hg: line 13: syntax error near unexpected token `'HGUNICODEPEDANTRY','
/usr/bin/hg: line 13: `if os.environ.get('HGUNICODEPEDANTRY', False):'
/usr/bin/hg: line 10: import: command not found
/usr/bin/hg: line 11: import: command not found
/usr/bin/hg: line 13: syntax error near unexpected token `'HGUNICODEPEDANTRY','
/usr/bin/hg: line 13: `if os.environ.get('HGUNICODEPEDANTRY', False):'
../../src/Makefile.src:312: recipe for target '../../platform/EOSM.202/version.bin' failed
make: *** [../../platform/EOSM.202/version.bin] Error 2

chris@melo2 ~/magic-lantern/platform/EOSM.202
$

dfort

Quote from: Meloware on March 06, 2017, 04:50:04 AM
Was this zipfile made on a Mac?

Yes. Didn't think that it would make much of a difference if I zipped on the PC or Mac and since my Mac is much faster--

The error message is very different now. The issue now looks like it might be a problem with Mercurial (hg). If you want to try and get the Cygwin system working try deleting the magic-lantern directory and re-clone the repository. If that doesn't work, use the Cygwin installer to reinstall Mercurial.

However, looks like you've got a Virtual Linux system running and can compile ML so it is probably best to take the path of least resistance and continue with that development environment.