tags 683925 + patch thanks On Sun, Aug 05, 2012 at 03:28:30PM +0200, Felix Geyer wrote: > ocp 1:0.1.21-1 fails to build from source with gcc-4.7 on i386. > > The build failure seems similar to http://bugs.debian.org/672991 > It has been fixed with this patch: > http://anonscm.debian.org/gitweb/?p=collab-maint/mupen64plus-core.git;a=blob;f=debian/patches/rjump_gcc47.patch;h=640a33cc64b75a9dd0c4443fa34be67c1eae5daf;hb=HEAD > > devw/dwmixfa_8087.c has a number of references to __i686.get_pc_thunk
I have prepared a patch based on the URL you have specified above. I have attached a debdiff and a quilt-type patch. The build worked fine on amd64, but I have no way of testing it on i386, so if someone can test and find the patch to be in order, I can also offer an NMU if the maintainer is busy. Thanks. Kumar -- Kumar Appaiah
diff -Nru --exclude changelog ocp-0.1.21/debian/patches/fix-gcc47-pcthunk ocp-0.1.21/debian/patches/fix-gcc47-pcthunk --- ocp-0.1.21/debian/patches/fix-gcc47-pcthunk 1969-12-31 18:00:00.000000000 -0600 +++ ocp-0.1.21/debian/patches/fix-gcc47-pcthunk 2012-08-09 13:08:20.000000000 -0500 @@ -0,0 +1,36 @@ +Index: ocp-0.1.21/devw/dwmixfa_8087.c +=================================================================== +--- ocp-0.1.21.orig/devw/dwmixfa_8087.c 2011-11-06 11:28:54.000000000 -0600 ++++ ocp-0.1.21/devw/dwmixfa_8087.c 2012-08-09 13:08:12.000000000 -0500 +@@ -171,7 +171,12 @@ + /* store pointer to dwmixfa_state into EBX. Non PIC code already has this in place from stub */ + "pushl %%ebx\n" + +- "call __i686.get_pc_thunk.bx\n" ++#if __GNUC_PREREQ (4, 7) ++# define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg ++#else ++# define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg ++#endif ++ "call " GET_PC_THUNK_STR(reg) " \n" + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n" + "movl dwmixfa_state@GOT(%%ebx), %%ebx\n" + #endif +@@ -249,7 +254,7 @@ + ( + #ifdef __PIC__ + "pushl %%ebx\n" +- "call __i686.get_pc_thunk.bx\n" ++ "call " GET_PC_THUNK_STR(reg) "\n" + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n" + "pushl %%ebx\n" + "movl dwmixfa_state@GOT(%%ebx), %%ebx\n" +@@ -2264,7 +2269,7 @@ + */ + #ifdef __PIC__ + "pushl %%ebx\n" +- "call __i686.get_pc_thunk.bx\n" ++ "call " GET_PC_THUNK_STR(reg) " \n" + "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n" + "movl dwmixfa_state@GOT(%%ebx), %%ebx\n" + #else diff -Nru --exclude changelog ocp-0.1.21/debian/patches/series ocp-0.1.21/debian/patches/series --- ocp-0.1.21/debian/patches/series 2011-12-01 09:34:28.000000000 -0600 +++ ocp-0.1.21/debian/patches/series 2012-08-09 13:06:30.000000000 -0500 @@ -1,2 +1,3 @@ info-compression fix-desktop-file +fix-gcc47-pcthunk
Index: ocp-0.1.21/devw/dwmixfa_8087.c =================================================================== --- ocp-0.1.21.orig/devw/dwmixfa_8087.c 2011-11-06 11:28:54.000000000 -0600 +++ ocp-0.1.21/devw/dwmixfa_8087.c 2012-08-09 13:08:12.000000000 -0500 @@ -171,7 +171,12 @@ /* store pointer to dwmixfa_state into EBX. Non PIC code already has this in place from stub */ "pushl %%ebx\n" - "call __i686.get_pc_thunk.bx\n" +#if __GNUC_PREREQ (4, 7) +# define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg +#else +# define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg +#endif + "call " GET_PC_THUNK_STR(reg) " \n" "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n" "movl dwmixfa_state@GOT(%%ebx), %%ebx\n" #endif @@ -249,7 +254,7 @@ ( #ifdef __PIC__ "pushl %%ebx\n" - "call __i686.get_pc_thunk.bx\n" + "call " GET_PC_THUNK_STR(reg) "\n" "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n" "pushl %%ebx\n" "movl dwmixfa_state@GOT(%%ebx), %%ebx\n" @@ -2264,7 +2269,7 @@ */ #ifdef __PIC__ "pushl %%ebx\n" - "call __i686.get_pc_thunk.bx\n" + "call " GET_PC_THUNK_STR(reg) " \n" "addl $_GLOBAL_OFFSET_TABLE_, %%ebx\n" "movl dwmixfa_state@GOT(%%ebx), %%ebx\n" #else