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

FreeBSD compilation fixes #356

Open
PierreMarieBaty opened this issue Dec 22, 2023 · 7 comments
Open

FreeBSD compilation fixes #356

PierreMarieBaty opened this issue Dec 22, 2023 · 7 comments

Comments

@PierreMarieBaty
Copy link

In src/BRSRC13/CORE/STD/brstdfile.c line 91

int BrStdioEof(void* f) {
    return feof((FILE*)f); // Pierre-Marie Baty -- added type cast because feof(f) is a macro dereferencing f on some systems
}

in src/BRSRC13/CORE/V1DB/enables.c line 178

        v1db.renderer->dispatch->_partSet(v1db.renderer, BRT_MATRIX, 0, BRT_VIEW_TO_ENVIRONMENT_M34_F, (br_uint_32)&view_to_this); // Pierre-Marie Baty -- FIXME: probably incorrect cast on x64 systems, but necessary to compile without error

in src/harness/include/harness/winsock.h line 25, add

#include <netinet/in.h> // Pierre-Marie Baty -- POSIX location of struct sockaddr_in

After these fixes, dethrace compiles successfully on FreeBSD/arm64 FWIW.

@PierreMarieBaty
Copy link
Author

Also a stack trace display improvement that will affect Linux as well, in src/harness/os/linux.c line 66

    sprintf(addr2line_cmd, "addr2line -f -p -e \"%s\" %p", program_name, addr - get_dethrace_offset()); // Pierre-Marie Baty -- support pathnames containing spaces

Replacing %.256s with "%s" ensures addr2line doesn't fail for programs whose full pathname contains spaces (e.g. located in "~/Documents/My Stuff/Some Path/Containing spaces/...").

BTW, looking good: https://i.postimg.cc/qM1V6C53/temp-Imagehx1-Pj4.jpg

@interkosmos
Copy link

Also, src/harness/harness.c must be linked against libexecinfo on FreeBSD:

target_link_libraries(harness PRIVATE execinfo)

(Tested with 0.6.0.)

@PierreMarieBaty
Copy link
Author

PierreMarieBaty commented Jan 7, 2024 via email

@madebr
Copy link
Collaborator

madebr commented Jan 7, 2024

What functions, provided by execinfo, is dethrace using?

About your shell script, I suppose you're linking with $(pkg-config --libs sdl2)?

@PierreMarieBaty
Copy link
Author

PierreMarieBaty commented Jan 7, 2024 via email

@interkosmos
Copy link

libinotify and libusbhid are dependencies of the FreeBSD SDL2 package.

Not necessarily, depends on your SDL2 build options.

@PierreMarieBaty
Copy link
Author

PierreMarieBaty commented Jan 10, 2024 via email

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