Ticket #6090: 0001-Recognize-huge-unsigned-long-long-values-as-integers.patch

File 0001-Recognize-huge-unsigned-long-long-values-as-integers.patch, 1.4 KB (added by mtjm, 2 years ago)

patch fixing the issue

  • CrossCodegen.hs

    From e89c4be8c203c684d4e433d387074d2c2a95ffe1 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Micha=C5=82=20Mas=C5=82owski?= <mtjm@mtjm.eu>
    Date: Fri, 11 May 2012 15:18:06 +0200
    Subject: [PATCH] Recognize huge unsigned long long values as integers when
     cross compiling.
    
    MIPS N32 has RLIM_INFINITY in resource.h defined as
    0x7fffffffffffffffULL which doesn't fit in a 32 bit unsigned long to
    which it was casted before applying this patch, so a cross build of
    libraries/unix for mips64el failed.
    ---
     CrossCodegen.hs |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/CrossCodegen.hs b/CrossCodegen.hs
    index b4f648f..7fbd20a 100644
    a b checkConditional _ = error "checkConditional argument isn't a Special" 
    499499-- Make sure the value we're trying to binary search isn't floating point. 
    500500checkValueIsIntegral :: ZCursor Token -> Bool -> TestMonad Bool 
    501501checkValueIsIntegral z@(ZCursor (Special _ _ value) _ _) nonNegative = do 
    502     let intType = if nonNegative then "unsigned long" else "long" 
     502    let intType = if nonNegative then "unsigned long long" else "long long" 
    503503    testLog ("checking if " ++ value ++ " is an integer") $ do 
    504504        success <- runCompileBooleanTest z $ "(" ++ intType ++ ")(" ++ value ++ ") == (" ++ value ++ ")" 
    505505        testLog' $ "result: " ++ (if success then "integer" else "floating")