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

Unbreak build on FreeBSD #4655

Merged
merged 2 commits into from
May 24, 2018
Merged

Unbreak build on FreeBSD #4655

merged 2 commits into from
May 24, 2018

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented May 23, 2018

Regressed by #4635. See error log.

Any plan to update the affected file periodically?

GNU libc and musl have aligned_alloc() in <stdlib.h> while on BSDs
<malloc.h> shouldn't be used.

In file included from rpcs3/Emu/RSX/VK/VKMemAlloc.cpp:2:
In file included from rpcs3/../3rdparty/GPUOpen/include/vk_mem_alloc.h:2233:
/usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
 #error "<malloc.h> has been replaced by <stdlib.h>"
  ^
@kd-11
Copy link
Contributor

kd-11 commented May 24, 2018

@jbeich Yes, if it is a bug it should be reported upstream so that we do not have to modify the file each time the file changes. Does malloc.h not exist on BSD? Or what is the actual problem?

@JohnHolmesII
Copy link
Contributor

It could be related to the whole 64 bit overflow thing. Thought that was patched though.

@jbeich
Copy link
Contributor Author

jbeich commented May 24, 2018

should be reported upstream

GPUOpen isn't in .gitmodules. What is the correct upstream?

Does malloc.h not exist on BSD?

Correct. See FreeBSD, DragonFly, OpenBSD commits. DragonFly, NetBSD, OpenBSD don't have malloc extensions. FreeBSD has (e.g., malloc_usable_size, mallctl*, *allocx) in <malloc_np.h>. However, aligned_alloc is C11/C++17 feature, not an extension.

@kd-11
Copy link
Contributor

kd-11 commented May 24, 2018

Allocator project here.
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
Will still commit the change if they do not wish to add it, but I think its worth notifying them that their header is not compatible with bsd family.

@jbeich
Copy link
Contributor Author

jbeich commented May 24, 2018

@Nekotekina Nekotekina merged commit c09c792 into RPCS3:master May 24, 2018
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

Successfully merging this pull request may close these issues.

None yet

4 participants