libretro / libretro-super

Super repo for other libretro projects. Fetches, builds and installs.
MIT License
403 stars 283 forks source link

libretro-build-android.sh on Cygwin (Windows), some cores fail #10

Open Skylark13 opened 11 years ago

Skylark13 commented 11 years ago

Hello,

Some cores fail to compile with g++ "Argument list too long" errors when I try to compile with libretro-build-android.sh (on Windows, using Cygwin). One example is nestopia. I have no idea why that would be, especially since most other cores (snes9x-next, mednafen, pcsx_rearmed, ...) build fine.

My sources are in a directory several levels deep:

/home/guayj/work/libretro-super/libretro-nestopia/source/core

but I wouldn't think this is uncommon, or even overly long, considering more than half comes from the project's paths themselves...

Any clues as to why I'm getting this problem would be appreciated. Thanks in advance.

ToadKing commented 11 years ago

Windows has a maximum command length of 32767 characters that cannot be made larger. We've already ran into errors with FBA and MAME with this limit, and is not something that can easily be worked around. Putting all your stuff in a shorter directory might help, but some cores just can't be compiled without cross-compiling from Linux. (FBA on Android is one, since the Android makescripts use absolute paths.)

Skylark13 commented 11 years ago

Is there a mode that can show me what the command line is? 32767 characters should be enough for anyone (or was that 640k :-) ) but by seeing the command line I'll at least be able to see what I can do about it. Thanks.

joaopmarquesini commented 11 years ago

@ToadKing do you know if this applies to compiling on osx too ? I can't get FBA to compile here.

ToadKing commented 11 years ago

no idea if osx has a command line limit

joaopmarquesini commented 11 years ago

found it, its 262144.

would it help if I try to compile it on /a/ for example instead of /Users/workspace/android/libretro-super/ ?

ToadKing commented 11 years ago

maybe. give it a shot

AridRayne commented 10 years ago

I managed to get the FBA core to compile in Windows by adding

define cmd-build-shared-library
$(eval linkargs := $(call host-path,$@.linkargs))
@ echo 'Link arguments : ' $(linkargs)

$(hide) echo \
    -Wl,-soname,$(notdir $(LOCAL_BUILT_MODULE)) \
    -shared \
    --sysroot=$(call host-path,$(PRIVATE_SYSROOT_LINK)) \
    $(PRIVATE_LINKER_OBJECTS_AND_LIBRARIES) \
    $(PRIVATE_LDFLAGS) \
    $(PRIVATE_LDLIBS) \
    -o $(call host-path,$(LOCAL_BUILT_MODULE)) \
    > $(linkargs)

    $(hide) $(PRIVATE_CXX) @$(linkargs)
endef

to libretro-super\libretro-fba\svn-current\trunk\projectfiles\libretro-android\jni\Android.mk before include $(BUILD_SHARED_LIBRARY) I had to modify what SG57 wrote at http://irrlicht.sourceforge.net/forum/viewtopic.php?t=43449#p260385 to make it work with NDK r9d.