problems due fails to link if enable hardening [message #5880] |
Fri, 07 June 2019 08:01 |
|
i enable all hardening flags and have this error now:
libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_compress_core'
i only added that custom flags alongside of the mednafen ones:
-fomit-frame-pointer -march=i686 -mmmx -msse -mno-sse4 -mno-sse3
complete last trace was:
[ 678s] g++ -std=gnu++11 -fsigned-char -fno-fast-math -fno-unsafe-math-optimizations -fno-aggressive-loop-optimizations -fomit-frame-pointer -fstrict-aliasing -Wall -Wshadow -Wempty-body -Wignored-qualifiers -Wvla -Wvariadic-macros -Wdisabled-optimization -fno-pic -fno-pie -fno-PIC -fno-PIE -fwrapv -fjump-tables -fexceptions -fomit-frame-pointer -march=i686 -mmmx -msse -mno-sse4 -mno-sse3 -o mednafen debug.o error.o mempatcher.o settings.o endian.o Time.o mednafen.o git.o file.o general.o memory.o netplay.o state.o state_rewind.o movie.o player.o PSFLoader.o SSFLoader.o SNSFLoader.o SPCReader.o tests.o qtrecord.o Stream.o MemoryStream.o FileStream.o IPSPatcher.o cdplay/cdplay.o demo/demo.o gb/gb.o gb/gfx.o gb/gbGlobals.o gb/memory.o gb/sound.o gb/z80.o gba/GBAinline.o gba/arm.o gba/thumb.o gba/bios.o gba/eeprom.o gba/flash.o gba/GBA.o gba/Gfx.o gba/Globals.o gba/Mode0.o gba/Mode1.o gba/Mode2.o gba/Mode3.o gba/Mode4.o gba/Mode5.o gba/RTC.o gba/Sound.o gba/sram.o lynx/cart.o lynx/c65c02.o lynx/memmap.o lynx/mikie.o lynx/ram.o lynx/rom.o lynx/susie.o lynx/system.o md/vdp.o md/genesis.o md/genio.o md/header.o md/mem68k.o md/membnk.o md/memvdp.o md/memz80.o md/sound.o md/system.o md/cart/cart.o md/cart/map_eeprom.o md/cart/map_realtec.o md/cart/map_ssf2.o md/cart/map_ff.o md/cart/map_rom.o md/cart/map_sbb.o md/cart/map_yase.o md/cart/map_rmx3.o md/cart/map_sram.o md/cart/map_svp.o md/input/multitap.o md/input/4way.o md/input/megamouse.o md/input/gamepad.o md/cd/cd.o md/cd/timer.o md/cd/interrupt.o md/cd/pcm.o md/cd/cdc_cdd.o md/debug.o nes/nes.o nes/x6502.o nes/cart.o nes/fds.o nes/ines.o nes/input.o nes/nsf.o nes/nsfe.o nes/unif.o nes/vsuni.o nes/sound.o nes/filter.o nes/fds-sound.o nes/debug.o nes/dis6502.o nes/ppu/ppu.o nes/ppu/palette.o nes/boards/8237.o nes/boards/h2288.o nes/boards/simple.o nes/boards/super24.o nes/boards/mmc2and4.o nes/boards/vrc6.o nes/boards/emu2413.o nes/boards/vrc7.o nes/boards/96.o nes/boards/208.o nes/boards/187.o nes/boards/95.o nes/boards/fme7.o nes/boards/mmc5.o nes/boards/mmc3.o nes/boards/mmc1.o nes/boards/tengen.o nes/boards/90.o nes/boards/deirom.o nes/boards/n106.o nes/boards/maxicart.o nes/boards/112.o nes/boards/113.o nes/boards/114.o nes/boards/117.o nes/boards/22.o nes/boards/23.o nes/boards/25.o nes/boards/67.o nes/boards/68.o nes/boards/16.o nes/boards/97.o nes/boards/99.o nes/boards/151.o nes/boards/180.o nes/boards/182.o nes/boards/184.o nes/boards/88.o nes/boards/89.o nes/boards/92.o nes/boards/86.o nes/boards/82.o nes/boards/80.o nes/boards/18.o nes/boards/21.o nes/boards/228.o nes/boards/234.o nes/boards/232.o nes/boards/42.o nes/boards/ffe.o nes/boards/65.o nes/boards/nina06.o nes/boards/73.o nes/boards/32.o nes/boards/33.o nes/boards/41.o nes/boards/46.o nes/boards/72.o nes/boards/75.o nes/boards/76.o nes/boards/77.o nes/boards/colordreams.o nes/boards/140.o nes/boards/93.o nes/boards/94.o nes/boards/malee.o nes/boards/156.o nes/boards/supervision.o nes/boards/novel.o nes/boards/242.o nes/boards/246.o nes/boards/248.o nes/boards/15.o nes/boards/8.o nes/boards/193.o nes/boards/189.o nes/boards/244.o nes/boards/sachen.o nes/boards/107.o nes/boards/51.o nes/boards/152.o nes/boards/70.o nes/boards/185.o nes/boards/78.o nes/boards/87.o nes/boards/34.o nes/boards/222.o nes/boards/codemasters.o nes/boards/38.o nes/boards/240.o nes/boards/241.o nes/boards/163.o nes/boards/30.o nes/boards/190.o nes/boards/40.o nes/input/cursor.o nes/input/zapper.o nes/input/powerpad.o nes/input/arkanoid.o nes/input/shadow.o nes/input/fkb.o nes/input/hypershot.o nes/input/mahjong.o nes/input/oekakids.o nes/input/ftrainer.o nes/input/partytap.o nes/input/toprider.o nes/input/bbattler2.o nes/input/suborkb.o nes/ntsc/nes_ntsc.o pce/huc6280.o pce/pce.o pce/vce.o pce/input.o pce/huc.o pce/pcecd.o pce/hes.o pce/tsushin.o pce/mcgenjin.o pce/input/gamepad.o pce/input/tsushinkb.o pce/input/mouse.o pce/dis6280.o pce/debug.o pce_fast/huc6280.o pce_fast/pce.o pce_fast/vdc.o pce_fast/input.o pce_fast/huc.o pce_fast/hes.o pce_fast/pcecd.o pce_fast/pcecd_drive.o pce_fast/psg.o pcfx/king.o pcfx/soundbox.o pcfx/pcfx.o pcfx/interrupt.o pcfx/input.o pcfx/timer.o pcfx/rainbow.o pcfx/jrevdct.o pcfx/huc6273.o pcfx/fxscsi.o pcfx/input/gamepad.o pcfx/input/mouse.o pcfx/debug.o psx/psx.o psx/cpu.o psx/gte.o psx/irq.o psx/timer.o psx/dma.o psx/mdec.o psx/sio.o psx/cdc.o psx/spu.o psx/frontio.o psx/input/gamepad.o psx/input/dualanalog.o psx/input/dualshock.o psx/input/memcard.o psx/input/multitap.o psx/input/mouse.o psx/input/negcon.o psx/input/guncon.o psx/input/justifier.o psx/gpu.o psx/gpu_polygon.o psx/gpu_line.o psx/gpu_sprite.o psx/debug.o psx/dis.o sms/cart.o sms/memz80.o sms/pio.o sms/render.o sms/romdb.o sms/sms.o sms/sound.o sms/system.o sms/tms.o sms/vdp.o snes_faust/cpu.o snes_faust/snes.o snes_faust/apu.o snes_faust/cart.o snes_faust/input.o snes_faust/ppu.o vb/vb.o vb/timer.o vb/input.o vb/vip.o vb/vsu.o vb/debug.o wswan/gfx.o wswan/main.o wswan/memory.o wswan/comm.o wswan/v30mz.o wswan/sound.o wswan/tcache.o wswan/interrupt.o wswan/eeprom.o wswan/rtc.o wswan/debug.o wswan/dis/dis_decode.o wswan/dis/dis_groups.o wswan/dis/resolve.o wswan/dis/syntax.o hw_cpu/m68k/m68k.o hw_cpu/z80-fuse/z80.o hw_cpu/z80-fuse/z80_ops.o hw_cpu/v810/v810_cpu.o hw_cpu/v810/v810_cpuD.o hw_cpu/v810/v810_fp_ops.o hw_misc/arcade_card/arcade_card.o hw_sound/ym2413/emu2413.o hw_sound/ym2612/Ym2612_Emu.o hw_sound/gb_apu/Gb_Apu.o hw_sound/gb_apu/Gb_Apu_State.o hw_sound/gb_apu/Gb_Oscs.o hw_sound/sms_apu/Sms_Apu.o hw_sound/pce_psg/pce_psg.o hw_video/huc6270/vdc.o cdrom/cdromif.o cdrom/scsicd.o cdrom/CDUtility.o cdrom/crc32.o cdrom/galois.o cdrom/l-ec.o cdrom/recover-raw.o cdrom/lec.o cdrom/CDAccess.o cdrom/CDAccess_Image.o cdrom/CDAccess_CCD.o cdrom/CDAFReader.o cdrom/CDAFReader_Vorbis.o cdrom/CDAFReader_MPC.o cdrom/CDAFReader_SF.o sound/Blip_Buffer.o sound/Stereo_Buffer.o sound/Fir_Resampler.o sound/WAVRecord.o sound/OwlResampler.o sound/okiadpcm.o net/Net.o net/Net_POSIX.o compress/minilzo.o compress/ioapi.o compress/unzip.o compress/GZFileStream.o compress/ZLInflateFilter.o hash/md5.o hash/sha1.o hash/sha256.o string/escape.o string/string.o video/surface.o video/font-data.o video/font-data-18x18.o video/font-data-12x13.o video/png.o video/primitives.o video/text.o video/video.o video/tblur.o video/resize.o video/Deinterlacer.o resampler/resample.o cputest/cputest.o cputest/x86_cpu.o cheat_formats/gb.o cheat_formats/psx.o cheat_formats/snes.o drivers/libmdfnsdl.a sexyal/libsexyal.a -lasound -lm -ldl -lpthread -ljack -lpthread -L/usr/lib/i386-linux-gnu -lSDL libngp.a libsnes.a ss/libssfplay.a libdesa68.a libmdfnquicklz.a libvorbisidec.a libmpcdec.a libtrio.a -lsndfile -lz
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_compress_core':
[ 680s] quicklz.c:(.text+0x153): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x1cf): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x1df): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0x20b): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x219): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0x264): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x2ed): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x304): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x320): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x352): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x3a5): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x3d3): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x3fa): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x427): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x437): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0x526): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x5cd): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x602): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x637): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0x660): undefined reference to `fast_write'
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o):quicklz.c:(.text+0x6c3): more undefined references to `fast_write' follow
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_compress_core':
[ 680s] quicklz.c:(.text+0x70a): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x712): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0x73d): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x745): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0x76b): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0x7ca): undefined reference to `fast_write'
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_decompress_core':
[ 680s] quicklz.c:(.text+0x905): undefined reference to `fast_read_safe'
[ 680s] quicklz.c:(.text+0x941): undefined reference to `fast_read_safe'
[ 680s] quicklz.c:(.text+0x9fd): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0xa28): undefined reference to `memcpy_up'
[ 680s] quicklz.c:(.text+0xa48): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0xa50): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0xaef): undefined reference to `fast_read_safe'
[ 680s] quicklz.c:(.text+0xb3b): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0xb43): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0xbb6): undefined reference to `memcpy_up'
[ 680s] quicklz.c:(.text+0xc17): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0xc1f): undefined reference to `hash_func'
[ 680s] quicklz.c:(.text+0xcf8): undefined reference to `fast_read'
[ 680s] quicklz.c:(.text+0xd00): undefined reference to `hash_func'
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_size_decompressed':
[ 680s] quicklz.c:(.text+0xdbc): undefined reference to `fast_read'
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_size_compressed':
[ 680s] quicklz.c:(.text+0xe23): undefined reference to `fast_read'
[ 680s] libmdfnquicklz.a(libmdfnquicklz_a-quicklz.o): In function `qlz_compress':
[ 680s] quicklz.c:(.text+0xfcf): undefined reference to `fast_write'
[ 680s] quicklz.c:(.text+0xfee): undefined reference to `fast_write'
[ 680s] collect2: error: ld returned 1 exit status
|
|
Re: problems due fails to link if enable hardening [message #5881 is a reply to message #5880 ] |
Fri, 07 June 2019 12:31 |
|
You forgot -O2
|
|
Re: problems due fails to link if enable hardening [message #5882 is a reply to message #5881 ] |
Fri, 07 June 2019 14:40 |
|
i do not want the -O2 men! that's nothing to do!
|
|
Re: problems due fails to link if enable hardening [message #5883 is a reply to message #5882 ] |
Fri, 07 June 2019 19:40 |
|
If you don't compile with optimizations enabled, much of Mednafen is going to be unusably slow.
Are you trying to compile an older version? The issue with QuickLZ should be fixed in 1.22.2.
|
|
Re: problems due fails to link if enable hardening [message #5884 is a reply to message #5883 ] |
Fri, 07 June 2019 22:20 |
|
oh so then was a bug! ok thanks for the confirmation.. but i cannot compile a 1.X verson..only 0.9.4X releases please helpme and tell me how to patch the problem...
|
|
Re: problems due fails to link if enable hardening [message #5885 is a reply to message #5880 ] |
Fri, 07 June 2019 23:36 |
|
the coding of mednafen are insane and very ugly... well but works: here the patch that solveds. . puff various releases later was solved very late!
here the patch:
Index: mednafen09-0.9.48/src/quicklz/quicklz.c
===================================================================
--- mednafen09-0.9.48.orig/src/quicklz/quicklz.c 2019-06-07 23:44:51.000000000 -0430
+++ mednafen09-0.9.48/src/quicklz/quicklz.c 2019-06-07 23:44:51.000000000 -0430
@@ -39,12 +39,12 @@
return -1;
}
-__inline unsigned int hash_func(unsigned int i)
+static inline unsigned int hash_func(unsigned int i)
{
return ((i >> 12) ^ i) & 0x0fff;
}
-__inline unsigned int fast_read(void const *src, unsigned int bytes)
+static inline unsigned int fast_read(void const *src, unsigned int bytes)
{
#ifndef X86X64
unsigned char *p = (unsigned char*)src;
@@ -68,7 +68,7 @@
#endif
}
-__inline void fast_write(unsigned int f, void *dst, unsigned int bytes)
+static inline void fast_write(unsigned int f, void *dst, unsigned int bytes)
{
#ifndef X86X64
unsigned char *p = (unsigned char*)dst;
@@ -118,7 +118,7 @@
#endif
}
-__inline void memcpy_up(unsigned char *dst, const unsigned char *src, unsigned int n)
+static inline void memcpy_up(unsigned char *dst, const unsigned char *src, unsigned int n)
{
// cannot be replaced by overlap handling of memmove() due to LZSS algorithm
#ifndef X86X64
@@ -151,7 +151,7 @@
#endif
}
-__inline unsigned int fast_read_safe(void const *src, unsigned int bytes, const unsigned char *invalid)
+static inline unsigned int fast_read_safe(void const *src, unsigned int bytes, const unsigned char *invalid)
{
#ifdef memory_safe
if ((const unsigned char *)src + 4 > (const unsigned char *)invalid)
|
|
Re: problems due fails to link if enable hardening [message #5886 is a reply to message #5880 ] |
Sun, 09 June 2019 01:56 |
|
it's always a great idea to tell the developer of a nice software how ugly his/her code is.
such things surely keep them motivated to continue development.
|
|
Re: problems due fails to link if enable hardening [message #5887 is a reply to message #5886 ] |
Sun, 09 June 2019 07:30 |
|
please: i can track the many times others said : "hey can you put the code in a git/svn etc"? and event do the right thing! keep the work in a hard way of contribution!
so then motivation are ther'.. sorry but people said what are the best way!
|
|