-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix build on mips #44
base: master
Are you sure you want to change the base?
Conversation
[Retrieved (and slightly updated to patch configure.ac instead of configure) from: https://git.buildroot.net/buildroot/tree/package/dmalloc/0002-mips.patch]
@@ -680,7 +680,7 @@ int main() | |||
])], | |||
[ AC_DEFINE(RETURN_MACROS_WORK, 1) AC_MSG_RESULT([yes]) ], | |||
[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ], | |||
[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this? I still want the default to be off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AC_RUN_IFELSE
can't be run when cross-compiling, so we have to update action-if-cross-compiling
which is only used when cross-compiling: https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Runtime.html
Without this change, RETURN_MACROS_WORK
will always be set to 0 when cross-compiling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what happens if someone is cross compiling onto an architecture that causes the return address code to segfault. By forcing the yes it will be forcing a broken result. You should be able to override the RETURN_MACROS_WORK
default for your particular build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the appropriate way to do that is to alter the settings.h
file and set USE_RETURN_MACROS
to be 1.
@@ -117,26 +117,16 @@ | |||
/*************************************/ | |||
|
|||
/* | |||
* For DEC Mips machines running Ultrix | |||
* For Mips machines running Linux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some way to detect Mips running Linux better than just __mips?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, the only "standard" way is to check for __mips
or __mips__
(cf. https://sourceforge.net/p/predef/wiki/Architectures or https://wiki.debian.org/ArchitectureSpecificsMemo)
Do you have other comments on my answers? |
Does this work with -O2 @ffontaine ? I've seen some return address code causing segfaults with optimization enabled. |
Yes, this works. This patch has been applied since 2006 in buildroot. Since that time, we didn't get any bug reports from our users or any build failures on the autobuilders. |
Do you plan to merge this PR? |
Fix the following build failure raised since bump to version 5.6.5 in commit 736932c: In file included from /home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/string.h:631:0, from arg_check.c:31: dmalloc.h:377:7: error: expected identifier or '(' before '__extension__' char *strdup(const char *string); ^ This build failure is raised because 0004-fix-strdup.patch was wrongly removed and because configure.ac wrongly assumes that strdup macro is not available when cross-compiling As configure.ac can't be patched because autoreconf is not working, patch configure as already done in DMALLOC_POST_PATCH. An upstream patch on configure.ac will be sent as soon as upstream merges this old PR: j256/dmalloc#44 Fixes: - http://autobuild.buildroot.org/results/00565c4b0618ea5f553d8c22284637b6574e4a93 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
No update on this 3-year old PR? |
[Retrieved (and slightly updated to patch configure.ac instead of configure) from:
https://git.buildroot.net/buildroot/tree/package/dmalloc/0002-mips.patch]