libretro, build fixes for android

This commit is contained in:
kub 2020-07-16 19:29:34 +02:00
parent 368c918050
commit 713e3a1c5b
9 changed files with 81 additions and 72 deletions

View file

@ -51,8 +51,8 @@ check_obj ()
fi
# find the start line of the .rodata section; read the next line
ro=$($OBJDUMP -s /tmp/getoffs.o | awk '\
/Contents of section.*(__const|.rodata|.sdata)/ {o=1; next} \
{if(o) { gsub(/ .*/,""); $1=""; gsub(/ /,""); print; o=0}}')
/Contents of section.*(__const|.ro?data|.sdata)/ {o=1; next} \
{if(o) { gsub(/ .*/,""); $1=""; gsub(/ /,""); print; exit}}')
# no working tool for extracting the ro data; stop here
if [ -z "$ro" ]; then
echo "/* mkoffset.sh: no readelf or not ELF, offset table not created */" >$fn
@ -79,8 +79,8 @@ compile_rodata ()
elif [ -n "$OBJDUMP" ]; then
# find the start line of the .rodata section; read the next line
ro=$($OBJDUMP -s /tmp/getoffs.o | awk '\
/Contents of section.*(__const|.rodata|.sdata)/ {o=1; next} \
{if(o) { gsub(/ .*/,""); $1=""; gsub(/ /,""); print; o=0}}')
/Contents of section.*(__const|.ro?data|.sdata)/ {o=1; next} \
{if(o) { gsub(/ .*/,""); $1=""; gsub(/ /,""); print; exit}}')
fi
if [ "$ENDIAN" = "le" ]; then
# swap needed for le target
@ -104,7 +104,7 @@ get_define () # prefix struct member member...
name=$(echo $* | sed 's/ /_/g')
echo '#include <stdint.h>' > /tmp/getoffs.c
echo '#include "pico/pico_int.h"' >> /tmp/getoffs.c
echo "static const struct $struct p;" >> /tmp/getoffs.c
echo "static struct $struct p;" >> /tmp/getoffs.c
echo "const int32_t val = (char *)&p.$field - (char*)&p;" >>/tmp/getoffs.c
compile_rodata
line=$(printf "#define %-20s 0x%04x" $prefix$name $rodata)

View file

@ -0,0 +1,39 @@
/* autogenerated by mkoffset.sh, do not edit */
/* target endianess: le, compiled with: x86_64-w64-mingw32-gcc */
#define OFS_Pico_video_reg 0x0000
#define OFS_Pico_m_rotate 0x0040
#define OFS_Pico_m_z80Run 0x0041
#define OFS_Pico_m_dirtyPal 0x0046
#define OFS_Pico_m_hardware 0x0047
#define OFS_Pico_m_z80_reset 0x004f
#define OFS_Pico_m_sram_reg 0x0049
#define OFS_Pico_sv 0x0090
#define OFS_Pico_sv_data 0x0090
#define OFS_Pico_sv_start 0x0098
#define OFS_Pico_sv_end 0x009c
#define OFS_Pico_sv_flags 0x00a0
#define OFS_Pico_rom 0x0588
#define OFS_Pico_romsize 0x0590
#define OFS_Pico_est 0x00d8
#define OFS_EST_DrawScanline 0x0000
#define OFS_EST_rendstatus 0x0004
#define OFS_EST_DrawLineDest 0x0008
#define OFS_EST_HighCol 0x0010
#define OFS_EST_HighPreSpr 0x0018
#define OFS_EST_Pico 0x0020
#define OFS_EST_PicoMem_vram 0x0028
#define OFS_EST_PicoMem_cram 0x0030
#define OFS_EST_PicoOpt 0x0038
#define OFS_EST_Draw2FB 0x0040
#define OFS_EST_HighPal 0x0048
#define OFS_PMEM_vram 0x10000
#define OFS_PMEM_vsram 0x22100
#define OFS_PMEM32x_pal_native 0x90e00
#define OFS_SH2_is_slave 0x0a18
#define OFS_SH2_p_bios 0x0098
#define OFS_SH2_p_da 0x00a0
#define OFS_SH2_p_sdram 0x00a8
#define OFS_SH2_p_rom 0x00b0
#define OFS_SH2_p_dram 0x00b8
#define OFS_SH2_p_drcblk_da 0x00c0
#define OFS_SH2_p_drcblk_ram 0x00c8

View file

@ -1,39 +0,0 @@
/* autogenerated by mkoffset.sh, do not edit */
/* target endianess: le, compiled with: mipsel-linux-gnu-gcc -mabi=n32 */
#define OFS_Pico_video_reg 0x0000
#define OFS_Pico_m_rotate 0x0040
#define OFS_Pico_m_z80Run 0x0041
#define OFS_Pico_m_dirtyPal 0x0046
#define OFS_Pico_m_hardware 0x0047
#define OFS_Pico_m_z80_reset 0x004f
#define OFS_Pico_m_sram_reg 0x0049
#define OFS_Pico_sv 0x008c
#define OFS_Pico_sv_data 0x008c
#define OFS_Pico_sv_start 0x0090
#define OFS_Pico_sv_end 0x0094
#define OFS_Pico_sv_flags 0x0098
#define OFS_Pico_rom 0x0554
#define OFS_Pico_romsize 0x0558
#define OFS_Pico_est 0x00c8
#define OFS_EST_DrawScanline 0x0000
#define OFS_EST_rendstatus 0x0004
#define OFS_EST_DrawLineDest 0x0008
#define OFS_EST_HighCol 0x000c
#define OFS_EST_HighPreSpr 0x0010
#define OFS_EST_Pico 0x0014
#define OFS_EST_PicoMem_vram 0x0018
#define OFS_EST_PicoMem_cram 0x001c
#define OFS_EST_PicoOpt 0x0020
#define OFS_EST_Draw2FB 0x0024
#define OFS_EST_HighPal 0x0028
#define OFS_PMEM_vram 0x10000
#define OFS_PMEM_vsram 0x22100
#define OFS_PMEM32x_pal_native 0x90e00
#define OFS_SH2_is_slave 0x055c
#define OFS_SH2_p_bios 0x0080
#define OFS_SH2_p_da 0x0084
#define OFS_SH2_p_sdram 0x0088
#define OFS_SH2_p_rom 0x008c
#define OFS_SH2_p_dram 0x0090
#define OFS_SH2_p_drcblk_da 0x0094
#define OFS_SH2_p_drcblk_ram 0x0098

View file

@ -1 +0,0 @@
generic32-offsets.h