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

building on FreeBSD 12.0 amd64 #101

Closed
nunotexbsd opened this issue May 6, 2019 · 10 comments
Closed

building on FreeBSD 12.0 amd64 #101

nunotexbsd opened this issue May 6, 2019 · 10 comments

Comments

@nunotexbsd
Copy link
Contributor

Hello,

I'm using FreeBSD 12.0 amd64:
cmake-3.14.3
gcc8-8.3.0
sdl2-2.0.9
sdl2_mixer-2.0.4
sdl2_ttf-2.0.15

I instructed cmake to use gcc instead of clang (base) and I only received a warning:
"CMake Warning at CMakeLists.txt:59 (message):
Not 32-bit, highly experimental!"

build stops around 60%.

I attached a log with build error.

Thanks,

Nuno Teixeira
build.log

@AJenbo
Copy link
Member

AJenbo commented May 6, 2019

Please see #49 where the build issues for FreeBSD are solved. The reason it hasn't been merged yet is that the MPQ isn't being correctly loaded/detected. If you can solve that we would be happy to merge it.

We might also soon implement direct file access (#46), that would also mean that we could merge it.

@nunotexbsd
Copy link
Contributor Author

Thanks for the link.

Other thing: I forgot that I was building in 64 bit enviroment and it must be 32.

Nuno Teixeira

@AJenbo
Copy link
Member

AJenbo commented May 6, 2019

The 64bit builds are actually starting to be fairly stable and playable but still aren't able to load save games.

@nunotexbsd
Copy link
Contributor Author

btw, I just builded Kraileth fork and I compile it 100% but it failed with:

[100%] Linking CXX executable devilutionx
/usr/local/bin/ld: cannot find -lasan

cmake with:
-DCMAKE_C_COMPILER=/usr/local/bin/gcc8
-DCMAKE_CXX_COMPILER=/usr/local/bin/g++8
DASAN=OFF

and

-DCMAKE_C_COMPILER=/usr/local/bin/gcc8
-DCMAKE_CXX_COMPILER=/usr/local/bin/g++8

same result.

Tomorrow I will try to get a 32 bit jail for building.

Thanks

@kraileth
Copy link
Contributor

kraileth commented May 7, 2019

If you copied the cmake defines here, then I'd say you're missing a minus in front of the last one. This would explain why it tries to link against libasan. Great to see another FreeBSD user here, BTW!

@nunotexbsd
Copy link
Contributor Author

Hello Kraileth,

Thanks :)

I send a message to freebsd forum to see if we can get more help porting this to freebsd:

https://forums.freebsd.org/threads/fan-of-diablo-i-devilutionx-almost-working-on-freebsd.70704/

BTW, I own an original copy of Diablo I that is included with Battle Chest (Diablo II/Diablo II Expansion). I will not quit until I play it :).

Cheers,

Nuno

@AJenbo
Copy link
Member

AJenbo commented May 12, 2019

So direct file access is now implemented if you want to try getting it running without the MPQ, be aware that speech and music are explicitly loaded from the MPQ by the engine so they will be absent.

@kraileth
Copy link
Contributor

@AJenbo: Thanks a lot for porting this over from Devilution! I just freed one hard drive, installed a fresh i386 FreeBSD 12 and gave it a try. After cloning the current version of DevilutionX and making the changes you committed to the FreeBSD branch to the three files, the project still builds as before.

Unfortunately I was not able to test direct mode - the executable produced by the current code crashes with a bus error... :(

I ran the program again with truss (think FreeBSD equivalent of strace). While I have no idea what is going on here, maybe this will give you (or any other developer) an idea where the crash happens (if the full output instead of just the last 50 lines or so is required I can of course provide that, too):

mmap(0xfbbfe000,4096,PROT_NONE,MAP_ANON,-1,0x0)  = -71311360 (0xfbbfe000)
rtprio_thread(RTP_LOOKUP,100409,0xffbfdc10)      = 0 (0x0)
sysarch(I386_SET_GSBASE,0xffbfdc28)              = 0 (0x0)
sigaction(SIGTHR,{ 0x2857f850 SA_SIGINFO ss_t },0x0) = 0 (0x0)
sigprocmask(SIG_UNBLOCK,{ },0x0)                 = 0 (0x0)
_umtx_op(0xffbfdbd4,UMTX_OP_WAKE,0x1,0x0,0x0)    = 0 (0x0)
mprotect(0x0,0,PROT_NONE)                        = 0 (0x0)
getpid()                                         = 6125 (0x17ed)
getpid()                                         = 6125 (0x17ed)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)                 = 0 (0x0)
getcontext(0xffbfd7d0)                           = 0 (0x0)
sysarch(I386_GET_XFPUSTATE,0xffbfd7a8)           = 0 (0x0)
mmap(0x0,24576,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691601408 (0x29390000)
__sysctl(0xffbfdb48,0x2,0xffbfdb40,0xffbfdb44,0x0,0x0) = 0 (0x0)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691625984 (0x29396000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691630080 (0x29397000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691634176 (0x29398000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691638272 (0x29399000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691642368 (0x2939a000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691646464 (0x2939b000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691650560 (0x2939c000)
mmap(0x0,2048,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691654656 (0x2939d000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691658752 (0x2939e000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691666944 (0x293a0000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691675136 (0x293a2000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691683328 (0x293a4000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691691520 (0x293a6000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691699712 (0x293a8000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691707904 (0x293aa000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691716096 (0x293ac000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691724288 (0x293ae000)
mmap(0x0,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691732480 (0x293b0000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691740672 (0x293b2000)
mkdir("/home",0700)                              ERR#17 'File exists'
mkdir("/home/kraileth",0700)                     ERR#17 'File exists'
mkdir("/home/kraileth/.local",0700)              ERR#17 'File exists'
mkdir("/home/kraileth/.local/share",0700)        ERR#17 'File exists'
mkdir("/home/kraileth/.local/share/diasurgical",0700) ERR#17 'File exists'
mkdir("/home/kraileth/.local/share/diasurgical/devilution",0700) ERR#17 'File exists'
mkdir("/home/kraileth/.local/share/diasurgical/devilution/",0700) ERR#17 'File exists'
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691744768 (0x293b3000)
mmap(0x0,20480,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 691748864 (0x293b4000)
SIGNAL 10 (SIGBUS) code=BUS_OBJERR trapno=9 addr=0x28b554f9
process killed, signal = 10 (core dumped)

@AJenbo
Copy link
Member

AJenbo commented May 12, 2019

Are you building with CLang or GGC? Try wapping.
Disable ASAN if you have it enabled.

I'm sorry but I'm not seeing the issue from the log :(

Looks like it's during loading of diablo.ini, or possibly SDL_init.

@AJenbo
Copy link
Member

AJenbo commented May 19, 2019

I'm closing this topic despite things only appearing to work on FreeBSD i386, for one thing, amd64 isn't fully supported in general, but secondly, I think a new investigation is in order regarding getting it to compile on FreeBSD using CLang as well as on a AMD64 installation.

@AJenbo AJenbo closed this as completed May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants