Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5987031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:45:23+00:00 2026-05-22T22:45:23+00:00

I have the following bits in my makefile : GLFW_FLAG := -m32 -O2 -Iglfw/include

  • 0

I have the following bits in my makefile:

GLFW_FLAG := -m32 -O2 -Iglfw/include -Iglfw/lib -Iglfw/lib/cocoa $(CFLAGS)
...
$(BUILD_DIR)/%.o : %.c
    $(CC) -c $(GLFW_FLAG) $< -o $@
$(BUILD_DIR)/%.o : %.m
    $(CC) -c $(GLFW_FLAG) $< -o $@

The -m32 instructs GCC to generate 32bit code. It’s there because on some configurations GHC is set to build 32bit code but GCC’s default is sometimes 64bit. I would like to generalize this so that it autodetects whether GHC is building 32bit or 64bit code and then passes the correct flag to GCC.

Question: How can I ask GHC what type of code (32bit vs. 64bit) it will build?

PS: My cabal file calls this makefile during the build to workaround limitations in cabal. I do wish I could just list these as c-sources in my cabal file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:45:24+00:00Added an answer on May 22, 2026 at 10:45 pm

    Thanks to Ed’ka I know the correct answer now.

    The Makefile now has a rule like this:

    GCCFLAGS  := $(shell ghc --info | ghc -e "fmap read getContents >>= putStrLn . unwords . read . Data.Maybe.fromJust . lookup \"Gcc Linker flags\"")
    

    It’s a bit long, but all it does is extract the “Gcc Linker flags” from ghc’s output. Note: This is the output of ghc --info and not ghc +RTS --info.

    This is better than the other suggested ways as it gives me all the flags that need to be specified and not just the -m flag. It’s also empty when no flags are needed.

    Thank you everyone!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our code I have the following, for now please ignore the //* bits;
I have installed 64 bits RHEL. I have following questions regarding ant.jar for the
I have the following struct: struct SysData { // Topic (32 bits) UTL_UINT16_Tdef SystemID:11;
I have the following data that basically I only need a few bits of
I have the following bits of code: <h:panelGroup rendered=#{userTypeController.permissionItemsUserType.contains(item)}> <h:selectBooleanCheckbox valueChangeListener=#{userTypeController.permissionChanged(this)} value=#{true}/> <h:outputText value=#{item.getAction()}
I have the following bits of code which, in my mind, seem like the
I have the following bits of code in my accountRepository public string[] GetRolesForUser(string email)
I have the following bits of code, scattered throughout my application. I'd really like
I have the following code that does a circular shift of the bits in
Let's say I have the following class structure: /** Boring bits snipped */ @Entity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.