[GH-ISSUE #661] clang debug build problem on 32bit linux #317

Closed
opened 2026-10-14 03:00:57 +07:00 by bsakaguchi · 11 comments
Owner

Originally created by @frank-dittrich on GitHub (Jun 21, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/661

Originally assigned to: @frank-dittrich on GitHub.

With

make distclean; CC=clang ./configure && make debug

I get

clang -DAC_BUILT -march=native -mssse3 -c -g -O2 -I/usr/local/include   -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE  -DHAVE_NSS -I/usr/include/nss3 -I/usr/include/nspr4     -pthread  -O0 -DDEBUG -funroll-loops gost.c -o gost.o
gost.c:147:4: error: inline assembly requires more registers than available
                        "movl %%ebx, %13\n\t"
                        ^
gost.c:147:4: error: inline assembly requires more registers than available
gost.c:147:4: error: inline assembly requires more registers than available
gost.c:147:4: error: inline assembly requires more registers than available
gost.c:147:4: error: inline assembly requires more registers than available
gost.c:147:4: error: inline assembly requires more registers than available
gost.c:147:4: error: inline assembly requires more registers than available
7 errors generated.
make[2]: *** [gost.o] Error 1
make[2]: Leaving directory `/home/fd/git/JtR/src'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/fd/git/JtR/src'
make: *** [debug] Error 2

When I change the Makefile generated by ./configure to use -O1 instead of -O0 for debug targets, the build succeeds.
gost.c is the only source which requires -O1, all other object files can be built with -O0.

With gcc, the debug build succeeds with -O0.

I am not sure what would be the best option to resolve the issue.
Generally switching to -O1 for debug builds (like Makefile.legacy does)?
Just using -O1 for 32bit builds, or only for 32bit clang builds?

Originally created by @frank-dittrich on GitHub (Jun 21, 2014). Original GitHub issue: https://github.com/openwall/john/issues/661 Originally assigned to: @frank-dittrich on GitHub. With ``` make distclean; CC=clang ./configure && make debug ``` I get ``` clang -DAC_BUILT -march=native -mssse3 -c -g -O2 -I/usr/local/include -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_NSS -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -O0 -DDEBUG -funroll-loops gost.c -o gost.o gost.c:147:4: error: inline assembly requires more registers than available "movl %%ebx, %13\n\t" ^ gost.c:147:4: error: inline assembly requires more registers than available gost.c:147:4: error: inline assembly requires more registers than available gost.c:147:4: error: inline assembly requires more registers than available gost.c:147:4: error: inline assembly requires more registers than available gost.c:147:4: error: inline assembly requires more registers than available gost.c:147:4: error: inline assembly requires more registers than available 7 errors generated. make[2]: *** [gost.o] Error 1 make[2]: Leaving directory `/home/fd/git/JtR/src' make[1]: *** [default] Error 2 make[1]: Leaving directory `/home/fd/git/JtR/src' make: *** [debug] Error 2 ``` When I change the Makefile generated by ./configure to use -O1 instead of -O0 for debug targets, the build succeeds. gost.c is the only source which requires -O1, all other object files can be built with -O0. With gcc, the debug build succeeds with -O0. I am not sure what would be the best option to resolve the issue. Generally switching to -O1 for debug builds (like Makefile.legacy does)? Just using -O1 for 32bit builds, or only for 32bit clang builds?
Author
Owner

@frank-dittrich commented on GitHub (Jun 21, 2014):

May be the problem is this:

-O0 -DDEBUG -funroll-loops

No, just tested it. Removing the -funroll-loops option didn't help.

<!-- gh-comment-id:46749036 --> @frank-dittrich commented on GitHub (Jun 21, 2014): May be the problem is this: ``` -O0 -DDEBUG -funroll-loops ``` No, just tested it. Removing the -funroll-loops option didn't help.
Author
Owner

@magnumripper commented on GitHub (Jun 21, 2014):

Perhaps this is just a bug in clang?

<!-- gh-comment-id:46758360 --> @magnumripper commented on GitHub (Jun 21, 2014): Perhaps this is just a bug in clang?
Author
Owner

@magnumripper commented on GitHub (Jun 22, 2014):

Some googling indicates that is the case. What if you manually do this:

clang -DAC_BUILT -march=native -mssse3 -c -g -O2 -I/usr/local/include   -Wall -Wdeclaration-after-statement -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE  -DHAVE_NSS -I/usr/include/nss3 -I/usr/include/nspr4     -pthread  -O0 -DDEBUG -fomit-frame-pointer -funroll-loops gost.c -o gost.o

I would not think -O0 turns off the preceeding -fomit-frame-pointer but if it does, this might work.

<!-- gh-comment-id:46768633 --> @magnumripper commented on GitHub (Jun 22, 2014): Some googling indicates that is the case. What if you manually do this: ``` clang -DAC_BUILT -march=native -mssse3 -c -g -O2 -I/usr/local/include -Wall -Wdeclaration-after-statement -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_NSS -I/usr/include/nss3 -I/usr/include/nspr4 -pthread -O0 -DDEBUG -fomit-frame-pointer -funroll-loops gost.c -o gost.o ``` I would not think -O0 turns off the preceeding -fomit-frame-pointer but if it does, this might work.
Author
Owner

@frank-dittrich commented on GitHub (Jun 22, 2014):

This results in the same error.

<!-- gh-comment-id:46783200 --> @frank-dittrich commented on GitHub (Jun 22, 2014): This results in the same error.
Author
Owner

@rohit-raddop commented on GitHub (Apr 6, 2017):

Did anyone find a workaround for it? I am facing the same issue.
"pushl %%ebx \n\t" .........

inline assembly requires more registers than available

<!-- gh-comment-id:292143209 --> @rohit-raddop commented on GitHub (Apr 6, 2017): Did anyone find a workaround for it? I am facing the same issue. "pushl %%ebx \n\t" ......... inline assembly requires more registers than available
Author
Owner

@magnumripper commented on GitHub (Apr 6, 2017):

Not that I know of. You probably need to upgrade clang or use gcc instead.

<!-- gh-comment-id:292144916 --> @magnumripper commented on GitHub (Apr 6, 2017): Not that I know of. You probably need to upgrade clang or use gcc instead.
Author
Owner

@rohit-raddop commented on GitHub (Apr 6, 2017):

I am using the latest version of clang. I can't move to GCC.

Does it mean I need to rewrite the entire assembly code?

<!-- gh-comment-id:292157591 --> @rohit-raddop commented on GitHub (Apr 6, 2017): I am using the latest version of clang. I can't move to GCC. Does it mean I need to rewrite the entire assembly code?
Author
Owner

@kholia commented on GitHub (Apr 6, 2017):

@Rohitpoddar92 This is the issue tracker for the JtR jumbo project. Are you trying to compile JtR and getting compilation errors OR are you compiling some other stuff and just complaining here? I can't tell.

Never mind, I think you are compiling JtR jumbo. Is there a specific reason why you are building debug builds?

<!-- gh-comment-id:292175032 --> @kholia commented on GitHub (Apr 6, 2017): @Rohitpoddar92 This is the issue tracker for the JtR jumbo project. Are you trying to compile JtR and getting compilation errors *OR* are you compiling some other stuff and just complaining here? I can't tell. Never mind, I think you are compiling JtR jumbo. Is there a specific reason why you are building debug builds?
Author
Owner

@rohit-raddop commented on GitHub (Apr 6, 2017):

ohh. sorry, I noticed it now.
I am not working on JtR combo. I am woking on some other project.

<!-- gh-comment-id:292226529 --> @rohit-raddop commented on GitHub (Apr 6, 2017): ohh. sorry, I noticed it now. I am not working on JtR combo. I am woking on some other project.
Author
Owner

@magnumripper commented on GitHub (Apr 6, 2017):

Duh. Good catch, @kholia!

<!-- gh-comment-id:292245891 --> @magnumripper commented on GitHub (Apr 6, 2017): Duh. Good catch, @kholia!
Author
Owner

@kholia commented on GitHub (Sep 13, 2018):

I guess no further action is required here.

<!-- gh-comment-id:420899496 --> @kholia commented on GitHub (Sep 13, 2018): I guess no further action is required here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#317
No description provided.