public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "HON  LUU" <hon@dreambigsemi.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>,
	"gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: RE: gcc question
Date: Mon, 13 Sep 2021 19:42:49 +0000	[thread overview]
Message-ID: <VI1PR02MB31187C1B5EB8631B444534DCDDD99@VI1PR02MB3118.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <VI1PR02MB31187F8FA0230724550E78F2DDD99@VI1PR02MB3118.eurprd02.prod.outlook.com>

BTW, the change is to make "-fPIC" not fail, but functional can be broken, since I don't run it with kernel.
Regards,
Hon

-----Original Message-----
From: HON LUU 
Sent: Monday, September 13, 2021 12:41 PM
To: Florian Weimer <fweimer@redhat.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>; gcc-help@gcc.gnu.org
Subject: RE: gcc question

Hi Florian,

Yes, understood the point. I would have to "not using -fPIC" if I could not found any way out. 
Anyway if I willing to change the asm function to change the constraint to something different from "i" (immediate), I wonder if the question is still proper.

Regards,
Hon 

 0:static __always_inline bool arch_static_branch(struct static_key *key, bool branch) {
 1:	asm_volatile_goto("1:"
 2:		".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
 3:		".pushsection __jump_table,  \"aw\" \n\t"
 4:		_ASM_ALIGN "\n\t"
 5:		_ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
 6:		".popsection \n\t"
 7:		: :  "i" (key),  "i" (branch) : : l_yes);
 8:
 9:	return false;
10:l_yes:
11:	return true;
}

-----Original Message-----
From: Florian Weimer <fweimer@redhat.com> 
Sent: Monday, September 13, 2021 12:23 PM
To: HON LUU <hon@dreambigsemi.com>
Cc: Segher Boessenkool <segher@kernel.crashing.org>; gcc-help@gcc.gnu.org
Subject: Re: gcc question

* HON LUU:

> + Another interesting note is:
>     + if I remove -fPIC from user space gcc command, then the code compile successfully. However -fPIC is the must for my project.

arch_static_branch is useable in the kernel (or kernel modules), but the kernel cannot be compiled with -fPIC.  So you have to stop using one thing or the other.

This isn't really a GCC question, is more about the kernel build system.

Thanks,
Florian


  parent reply	other threads:[~2021-09-13 19:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 15:06 HON  LUU
2021-09-08 16:20 ` Segher Boessenkool
2021-09-08 16:26   ` HON  LUU
2021-09-08 16:27   ` HON  LUU
2021-09-08 17:05   ` HON  LUU
2021-09-08 23:13     ` HON  LUU
2021-09-10 17:58       ` HON  LUU
2021-09-10 18:36         ` Segher Boessenkool
2021-09-11 21:08           ` HON  LUU
2021-09-13 19:10             ` HON  LUU
2021-09-13 19:22             ` Florian Weimer
2021-09-13 19:40               ` HON  LUU
2021-09-13 19:42                 ` Florian Weimer
2021-09-13 19:50                   ` HON  LUU
2021-09-13 19:51                     ` Florian Weimer
2021-09-13 19:52                       ` HON  LUU
2021-09-13 19:42                 ` HON  LUU [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-02-26 22:53 Brendan Darrer
2006-02-26 23:52 ` Ernest L. Williams Jr.
2006-02-27 15:29 ` Brian Budge
2002-06-12  9:29 j y
2002-06-12 11:16 ` Shawn Starr
2001-07-20  4:35 Steve Kieu
2000-08-13 19:34 tao tong
2000-04-10  7:46 GCC question Gibson, Terry
2000-04-10  8:12 ` Alexandre Oliva
2000-01-06 15:46 Black, Christopher T
2000-04-01  0:00 ` Black, Christopher T
     [not found] <947048956.20674.ezmlm@gcc.gnu.org>
2000-01-04 21:22 ` John Ratcliff
2000-04-01  0:00   ` John Ratcliff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR02MB31187C1B5EB8631B444534DCDDD99@VI1PR02MB3118.eurprd02.prod.outlook.com \
    --to=hon@dreambigsemi.com \
    --cc=fweimer@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).