★ wanayoo — archive 1999 https://github.com/python-cmake-buildsystem/python-cmake-buildsystem/issues/215Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue, FFI & CTYPES, musl libc, FDE_ENCODE() #215

Open
johnmudd opened this issue Mar 20, 2018 · 3 comments
Open

Build issue, FFI & CTYPES, musl libc, FDE_ENCODE() #215

johnmudd opened this issue Mar 20, 2018 · 3 comments

Comments

@johnmudd
Copy link

@johnmudd johnmudd commented Mar 20, 2018

Got the following trying to build 2.7.14 on Linux Mint 18 using musl libc.

[ 91%] Building ASM object CMakeBuild/libpython/CMakeFiles/libpython-static.dir/home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S.o
/home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S: Assembler messages:
/home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S:403: Error: junk at end of line, first unrecognized character is @' /home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S:424: Error: junk at end of line, first unrecognized character is @'
/home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S:454: Error: junk at end of line, first unrecognized character is `@'
CMakeBuild/libpython/CMakeFiles/libpython-static.dir/build.make:4190: recipe for target 'CMakeBuild/libpython/CMakeFiles/libpython-static.dir/home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S.o' failed
make[2]: *** [CMakeBuild/libpython/CMakeFiles/libpython-static.dir/home/mudd/musl-static/Python-2.7.14/Modules/_ctypes/libffi/src/x86/sysv.S.o] Error 1
CMakeFiles/Makefile2:1311: recipe for target 'CMakeBuild/libpython/CMakeFiles/libpython-static.dir/all' failed
make[1]: *** [CMakeBuild/libpython/CMakeFiles/libpython-static.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Here are the lines that have issues.
403: .long FDE_ENCODE(.LFB1) /* FDE initial location /
424: .long FDE_ENCODE(.LFB2) /
FDE initial location /
454: .long FDE_ENCODE(.LFB3) /
FDE initial location */

Here are all the lines with FDE_ENCODE(). It look like all are commented out?

#if defined __GNUC__
/* Only emit dwarf unwind info when building with GNU toolchain.  */

#if defined __PIC__
# if defined __sun__ && defined __svr4__
/* 32-bit Solaris 2/x86 uses datarel encoding for PIC.  GNU ld before 2.22
   doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this.  */
#  define FDE_ENCODING      0x30    /* datarel */
#  define FDE_ENCODE(X)     X@GOTOFF
# else
#  define FDE_ENCODING      0x1b    /* pcrel sdata4 */
#  if defined HAVE_AS_X86_PCREL
#   define FDE_ENCODE(X)    X-.
#  else
#   define FDE_ENCODE(X)    X@rel
#  endif
# endif
#else
# define FDE_ENCODING       0   /* absolute */
# define FDE_ENCODE(X)      X
#endif
@johnmudd
Copy link
Author

@johnmudd johnmudd commented Mar 20, 2018

Oh, I guess this is the problem.

#if defined __GNUC__
/* Only emit dwarf unwind info when building with GNU toolchain.  */

I need to get __GNUC__ set.

@jcfr
Copy link
Contributor

@jcfr jcfr commented Mar 20, 2018

Thanks for the report.

look like all are commented out

#  define FDE_ENCODE(X)         X@GOTOFF
[...]

In fact, these are pre-processor macros

Linux Mint 18 using musl libc.

To setup continuous integration using that system, it may be sensible to add a dockbuild image to https://github.com/dockbuild/dockbuild#readme similarly to what is being done for ubuntu dockbuild/dockbuild#17

@johnmudd
Copy link
Author

@johnmudd johnmudd commented Mar 21, 2018

It sounds like I need to recreate the issue inside a Docker "VM"? But even after looking at the links I don't know where to begin.

But that might have to wait. As a temporary work around I edited the sysv.S file, removed the __GNUC__ #ifdef and the make works. But now I'm unable to run the static python on other machines by just copying the python executable. I get "ImportError: No module named site".

I started over and used -DENABLE_CTYPES:BOOL=0 as a work around and still get error when try to run the single python file on other machines. This is strange because this much worked before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.