Opened 19 years ago

Closed 19 years ago

Last modified 10 years ago

#755 closed defect (worksforme)

SDL fails with certain CFLAGS or fails to detect correct machine Arch

Reported by: matt@… Owned by: blfs-book@…
Priority: lowest Milestone:
Component: BOOK Version: ~5.0
Severity: trivial Keywords:


This is a hard bug to reproduce. as I have only come across this after building a lot of LFS machines on different hardware

The problem I have come across on SDL 1.2.6 is that on a lot of platforms setting the gcc CFLAGS/CXXFLAGS with an -Ox optimisation causes failure, and not specifying any CFLAGS/CXXFLAGS causes the configure script to set -O2 which again causes it to fail. After much playing I came to the following conclusion optimisation on this package is not good, probably down to the ammount of use of nasm. The reason the optimisation appears to be failing is because if you don't set a -march=$your_cpu or other options that correctly identify your cpu the configure script does not always get it right. I don't know what causes the configure script to get it wrong but on one machine it set my pentium 3 to a pentiumpro and my Opteron to an AMD64. I've seen it have a few messy calls on the UltraSparc CPU also.

The only way I can get around this is to set my CFLAGS/CXXFLAGS to -march-cpu and leave it at that, this way the CPU is correctly identified and the configure script cannot force -O2 on the end, and you have not set any -Ox problems

This does appear a rare occurance in the SDL package, however it may be worth mentioning in the book to set your compile options to force the CPU type - and the CPU type alone, nothing else.

The error caused by this problem is normally some variation on

SDL_RLEaccel.c:845: error: invalid `asm': invalid expression as operand



Change History (3)

comment:1 by Randy McMurchy, 19 years ago

I could not reproduce this bug.

comment:2 by Randy McMurchy, 19 years ago

Resolution: worksforme
Status: newclosed

Again, could not reproduce this bug. Passing no optimization flags at all, the last two builds using LFS-6-testing platforms produce a normal build.

We'll open a new bug if something comes up in the future. Closing this one for now.

comment:3 by bdubbs@…, 10 years ago

Milestone: old

Milestone old deleted

Note: See TracTickets for help on using tickets.