public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC question
       [not found] <947048956.20674.ezmlm@gcc.gnu.org>
@ 2000-01-04 21:22 ` John Ratcliff
  2000-04-01  0:00   ` John Ratcliff
  0 siblings, 1 reply; 30+ messages in thread
From: John Ratcliff @ 2000-01-04 21:22 UTC (permalink / raw)
  To: gcc-help

Quick question.  I'm looking to put an embedded VM inside my application.
What I want is a C++ compiler that will produce an OS neutral byte code and
I will have a VM to interpret it.  I want the VM to be 100% ANSI complient,
OS neutral C or C++ code.

Java seems like the likely candidate, however the Java VM implementations I
have seen are rather huge.  One approach would be to have GCC produce, say
80386 code, and then write a C implementation of an 80386 emulator.
Actually not a bad idea....anybody got one laying around?

Is there a version of the GCC compiler that produces OS neutral VM byte code
and a corresponding *small* (very small) byte code interpreter for it,
written in C or C++?

What I want to accomplish is to download OS neutral binaries over the
internet to an application running on completely different processors.  One
is a Pentium but the other is a console machine that I am not at liberty to
discuss.  As well, there might be more processors I would support in the
future.  I want to be able to download and execute these binaries on any of
the machines.  I don't need a JIT compiler, that's overkill since this isn't
performance oriented code, mostly high level game logic calling high speed
native routines.

It there a solution short of including the rather massive, huge, and fat,
Java VM?  Or, is there a thin, skinny, small Java VM implementation?

Thanks,

John W. Ratcliff
Senior Software Engineer
Verant Interactive

^ permalink raw reply	[flat|nested] 30+ messages in thread

* GCC question
  2000-01-04 21:22 ` GCC question John Ratcliff
@ 2000-04-01  0:00   ` John Ratcliff
  0 siblings, 0 replies; 30+ messages in thread
From: John Ratcliff @ 2000-04-01  0:00 UTC (permalink / raw)
  To: gcc-help

Quick question.  I'm looking to put an embedded VM inside my application.
What I want is a C++ compiler that will produce an OS neutral byte code and
I will have a VM to interpret it.  I want the VM to be 100% ANSI complient,
OS neutral C or C++ code.

Java seems like the likely candidate, however the Java VM implementations I
have seen are rather huge.  One approach would be to have GCC produce, say
80386 code, and then write a C implementation of an 80386 emulator.
Actually not a bad idea....anybody got one laying around?

Is there a version of the GCC compiler that produces OS neutral VM byte code
and a corresponding *small* (very small) byte code interpreter for it,
written in C or C++?

What I want to accomplish is to download OS neutral binaries over the
internet to an application running on completely different processors.  One
is a Pentium but the other is a console machine that I am not at liberty to
discuss.  As well, there might be more processors I would support in the
future.  I want to be able to download and execute these binaries on any of
the machines.  I don't need a JIT compiler, that's overkill since this isn't
performance oriented code, mostly high level game logic calling high speed
native routines.

It there a solution short of including the rather massive, huge, and fat,
Java VM?  Or, is there a thin, skinny, small Java VM implementation?

Thanks,

John W. Ratcliff
Senior Software Engineer
Verant Interactive

^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  2021-09-13 19:51                     ` Florian Weimer
@ 2021-09-13 19:52                       ` HON  LUU
  0 siblings, 0 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-13 19:52 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Segher Boessenkool, gcc-help

I see. Thank you. 
Regards,
Hon

-----Original Message-----
From: Florian Weimer <fweimer@redhat.com> 
Sent: Monday, September 13, 2021 12:51 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:

> I build "device driver code" in userspace code, but using the same 
> headers from kernel source code.
>
> In the driver code, we include "linux/pci.h" header, and through 
> include chain arch_static_branch() got pulling through inline 
> functions.

You need to do replace arch_static_branch with something else.  It cannot be used in userspace.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  2021-09-13 19:50                   ` HON  LUU
@ 2021-09-13 19:51                     ` Florian Weimer
  2021-09-13 19:52                       ` HON  LUU
  0 siblings, 1 reply; 30+ messages in thread
From: Florian Weimer @ 2021-09-13 19:51 UTC (permalink / raw)
  To: HON LUU; +Cc: Segher Boessenkool, gcc-help

* HON LUU:

> I build "device driver code" in userspace code, but using the same
> headers from kernel source code.
>
> In the driver code, we include "linux/pci.h" header, and through
> include chain arch_static_branch() got pulling through inline
> functions.

You need to do replace arch_static_branch with something else.  It
cannot be used in userspace.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  2021-09-13 19:42                 ` Florian Weimer
@ 2021-09-13 19:50                   ` HON  LUU
  2021-09-13 19:51                     ` Florian Weimer
  0 siblings, 1 reply; 30+ messages in thread
From: HON  LUU @ 2021-09-13 19:50 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Segher Boessenkool, gcc-help

Hi Florian,

I build "device driver code" in userspace code, but using the same headers from kernel source code.

In the driver code, we include "linux/pci.h" header, and through include chain arch_static_branch() got pulling through inline functions.

Regards,
Hon

-----Original Message-----
From: Florian Weimer <fweimer@redhat.com> 
Sent: Monday, September 13, 2021 12:43 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:

> 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.

Are you building userspace code or kernel code?  Why do you end up compiling arch_static_branch?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  2021-09-13 19:40               ` HON  LUU
  2021-09-13 19:42                 ` Florian Weimer
@ 2021-09-13 19:42                 ` HON  LUU
  1 sibling, 0 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-13 19:42 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Segher Boessenkool, gcc-help

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


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  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:42                 ` HON  LUU
  1 sibling, 1 reply; 30+ messages in thread
From: Florian Weimer @ 2021-09-13 19:42 UTC (permalink / raw)
  To: HON LUU; +Cc: Segher Boessenkool, gcc-help

* HON LUU:

> 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.

Are you building userspace code or kernel code?  Why do you end up
compiling arch_static_branch?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  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:42                 ` HON  LUU
  0 siblings, 2 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-13 19:40 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Segher Boessenkool, gcc-help

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


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  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
  1 sibling, 1 reply; 30+ messages in thread
From: Florian Weimer @ 2021-09-13 19:22 UTC (permalink / raw)
  To: HON LUU; +Cc: Segher Boessenkool, gcc-help

* 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


^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  2021-09-11 21:08           ` HON  LUU
@ 2021-09-13 19:10             ` HON  LUU
  2021-09-13 19:22             ` Florian Weimer
  1 sibling, 0 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-13 19:10 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

Hi Segher,

Sorry to bother you, but I don't know how to proceed.
Anything that you can give me is greatly appreciated.
Anything you want me to do please let me know.

Thank you very much for your time,
Hon

-----Original Message-----
From: HON LUU 
Sent: Saturday, September 11, 2021 2:08 PM
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-help@gcc.gnu.org
Subject: RE: gcc question

Hi Segher,

Following is more information that I can collect. Please let me know if you need anything else.
Thank you very much for your help.

Regards,
Hon
=====================================================================

+ this is part of the content of cdev.c, from which the error happened
...
...
struct static_key_false test;

int qdma_cdev_init(void) {
   
    if (static_branch_unlikely(&test)) {
        printk("test...\n");
    }
	return 0;
}

void qdma_cdev_cleanup(void) {
}
...

+ static_branch_unlikely is defined as followed from /lib/modules/`uname -r`/build/include/linux/jump_label.h :

#define static_branch_unlikely(x)						\
({										\
	bool branch;								\
	if (__builtin_types_compatible_p(typeof(*x), struct static_key_true))	\
		branch = arch_static_branch_jump(&(x)->key, false);		\
	else if (__builtin_types_compatible_p(typeof(*x), struct static_key_false)) \
		branch = arch_static_branch(&(x)->key, false);			\
	else									\
		branch = ____wrong_branch_error();				\
	unlikely(branch);							\
})

+ the error is related to arch_static_branch_jump() which is defined from /lib/modules/`uname -r`/build/arch/x86/include/asm/jump_label.h as followed:

static __always_inline bool arch_static_branch(struct static_key *key, bool branch) {
	asm_volatile_goto("1:"
		".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
		".pushsection __jump_table,  \"aw\" \n\t"
		_ASM_ALIGN "\n\t"
		_ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
		".popsection \n\t"
		: :  "i" (key),  "i" (branch) : : l_yes);

	return false;
l_yes:
	return true;
}

+ The code compiled successfully in kernel mode with followed command:
    + make V=1 clean
    + make V=1
+ The code failed to compile when I try to compile into user space mode with the followed command:
    + make -f Makefile.user clean
    + make -f Makefile.user
+ Note that the difference between gcc command line between the 2 modes are:
    + kernel:      .... -fno-PIE ... -mcmodel=kernel ...
    + user space:  .... -fPIC    ... <  removed    > ...
+ 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.


-----Original Message-----
From: Segher Boessenkool <segher@kernel.crashing.org>
Sent: Friday, September 10, 2021 11:36 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc question

On Fri, Sep 10, 2021 at 05:58:07PM +0000, HON  LUU wrote:
> Hi Segher,
> 
> I wonder if you have any issues to reproduce the problem.

> Attached is the tar ball of stand alone module, which duplicate the issue.
> There is a README file, should be straightforward to duplicate the issue.

> You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

If you write up a good email with all the necessary info, you will get an answer (and a good answer!) much quicker.  I do not particularly feel like doing all the work here.  Sorry.


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  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
  0 siblings, 2 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-11 21:08 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

Hi Segher,

Following is more information that I can collect. Please let me know if you need anything else.
Thank you very much for your help.

Regards,
Hon
=====================================================================

+ this is part of the content of cdev.c, from which the error happened
...
...
struct static_key_false test;

int qdma_cdev_init(void) {
   
    if (static_branch_unlikely(&test)) {
        printk("test...\n");
    }
	return 0;
}

void qdma_cdev_cleanup(void) {
}
...

+ static_branch_unlikely is defined as followed from /lib/modules/`uname -r`/build/include/linux/jump_label.h :

#define static_branch_unlikely(x)						\
({										\
	bool branch;								\
	if (__builtin_types_compatible_p(typeof(*x), struct static_key_true))	\
		branch = arch_static_branch_jump(&(x)->key, false);		\
	else if (__builtin_types_compatible_p(typeof(*x), struct static_key_false)) \
		branch = arch_static_branch(&(x)->key, false);			\
	else									\
		branch = ____wrong_branch_error();				\
	unlikely(branch);							\
})

+ the error is related to arch_static_branch_jump() which is defined from /lib/modules/`uname -r`/build/arch/x86/include/asm/jump_label.h as followed:

static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{
	asm_volatile_goto("1:"
		".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
		".pushsection __jump_table,  \"aw\" \n\t"
		_ASM_ALIGN "\n\t"
		_ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
		".popsection \n\t"
		: :  "i" (key),  "i" (branch) : : l_yes);

	return false;
l_yes:
	return true;
}

+ The code compiled successfully in kernel mode with followed command:
    + make V=1 clean
    + make V=1
+ The code failed to compile when I try to compile into user space mode with the followed command:
    + make -f Makefile.user clean
    + make -f Makefile.user
+ Note that the difference between gcc command line between the 2 modes are:
    + kernel:      .... -fno-PIE ... -mcmodel=kernel ...
    + user space:  .... -fPIC    ... <  removed    > ...
+ 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.


-----Original Message-----
From: Segher Boessenkool <segher@kernel.crashing.org> 
Sent: Friday, September 10, 2021 11:36 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc question

On Fri, Sep 10, 2021 at 05:58:07PM +0000, HON  LUU wrote:
> Hi Segher,
> 
> I wonder if you have any issues to reproduce the problem.

> Attached is the tar ball of stand alone module, which duplicate the issue.
> There is a README file, should be straightforward to duplicate the issue.

> You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

If you write up a good email with all the necessary info, you will get an answer (and a good answer!) much quicker.  I do not particularly feel like doing all the work here.  Sorry.


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  2021-09-10 17:58       ` HON  LUU
@ 2021-09-10 18:36         ` Segher Boessenkool
  2021-09-11 21:08           ` HON  LUU
  0 siblings, 1 reply; 30+ messages in thread
From: Segher Boessenkool @ 2021-09-10 18:36 UTC (permalink / raw)
  To: HON LUU; +Cc: gcc-help

On Fri, Sep 10, 2021 at 05:58:07PM +0000, HON  LUU wrote:
> Hi Segher,
> 
> I wonder if you have any issues to reproduce the problem.

> Attached is the tar ball of stand alone module, which duplicate the issue.
> There is a README file, should be straightforward to duplicate the issue.

> You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

If you write up a good email with all the necessary info, you will get
an answer (and a good answer!) much quicker.  I do not particularly feel
like doing all the work here.  Sorry.


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  2021-09-08 23:13     ` HON  LUU
@ 2021-09-10 17:58       ` HON  LUU
  2021-09-10 18:36         ` Segher Boessenkool
  0 siblings, 1 reply; 30+ messages in thread
From: HON  LUU @ 2021-09-10 17:58 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

Hi Segher,

I wonder if you have any issues to reproduce the problem.

Regards,
Hon

-----Original Message-----
From: HON LUU 
Sent: Wednesday, September 8, 2021 4:14 PM
To: 'Segher Boessenkool' <segher@kernel.crashing.org>
Cc: 'gcc-help@gcc.gnu.org' <gcc-help@gcc.gnu.org>
Subject: RE: gcc question

Hi Segher,

Attached is the tar ball of stand alone module, which duplicate the issue.
There is a README file, should be straightforward to duplicate the issue.

Please let me know if I need to do anything else.

Thank you,
Hon


-----Original Message-----
From: HON LUU
Sent: Wednesday, September 8, 2021 10:05 AM
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-help@gcc.gnu.org
Subject: RE: gcc question

Hi Segher,

Let me work on stand alone setup to show the problem.

Thank you for your help.
Regards,
Hon

-----Original Message-----
From: Segher Boessenkool <segher@kernel.crashing.org>
Sent: Wednesday, September 8, 2021 9:20 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc question

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably 
> doesn’t match constraints [-Werror] #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in 
> ‘asm’ #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you would use this to get error messages that aren't translated, that the compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

GL;HF,


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  2021-09-08 17:05   ` HON  LUU
@ 2021-09-08 23:13     ` HON  LUU
  2021-09-10 17:58       ` HON  LUU
  0 siblings, 1 reply; 30+ messages in thread
From: HON  LUU @ 2021-09-08 23:13 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

Hi Segher,

Attached is the tar ball of stand alone module, which duplicate the issue.
There is a README file, should be straightforward to duplicate the issue.

Please let me know if I need to do anything else.

Thank you,
Hon


-----Original Message-----
From: HON LUU 
Sent: Wednesday, September 8, 2021 10:05 AM
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-help@gcc.gnu.org
Subject: RE: gcc question

Hi Segher,

Let me work on stand alone setup to show the problem.

Thank you for your help.
Regards,
Hon

-----Original Message-----
From: Segher Boessenkool <segher@kernel.crashing.org>
Sent: Wednesday, September 8, 2021 9:20 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc question

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably 
> doesn’t match constraints [-Werror] #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in 
> ‘asm’ #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you would use this to get error messages that aren't translated, that the compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

GL;HF,


Segher

[-- Attachment #2: user_space.tar.gz --]
[-- Type: application/x-gzip, Size: 2927 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* RE: gcc question
  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
  2 siblings, 1 reply; 30+ messages in thread
From: HON  LUU @ 2021-09-08 17:05 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

Hi Segher,

Let me work on stand alone setup to show the problem.

Thank you for your help.
Regards,
Hon

-----Original Message-----
From: Segher Boessenkool <segher@kernel.crashing.org> 
Sent: Wednesday, September 8, 2021 9:20 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: gcc question

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably 
> doesn’t match constraints [-Werror] #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in 
> ‘asm’ #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you would use this to get error messages that aren't translated, that the compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the declarations of everything used in its operands, for us to get a handle on what is going on here.  Bonus points if you manage to make a stand- alone compilable testcase that shows the problem.

GL;HF,


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  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
  2 siblings, 0 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-08 16:27 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

I am confused. I saw the rest of your response.
Let me go through it.

Regards,
Hon

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Segher Boessenkool <segher@kernel.crashing.org>
Sent: Wednesday, September 8, 2021 9:20:25 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org <gcc-help@gcc.gnu.org>
Subject: Re: gcc question

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably doesn’t match constraints [-Werror]
> #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in ‘asm’
> #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you
would use this to get error messages that aren't translated, that the
compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the
declarations of everything used in its operands, for us to get a handle
on what is going on here.  Bonus points if you manage to make a stand-
alone compilable testcase that shows the problem.

GL;HF,


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  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
  2 siblings, 0 replies; 30+ messages in thread
From: HON  LUU @ 2021-09-08 16:26 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

Yes, I got your email but only “Hi!”
 Thank you for responding.

Regards,
Hon

Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Segher Boessenkool <segher@kernel.crashing.org>
Sent: Wednesday, September 8, 2021 9:20:25 AM
To: HON LUU <hon@dreambigsemi.com>
Cc: gcc-help@gcc.gnu.org <gcc-help@gcc.gnu.org>
Subject: Re: gcc question

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably doesn’t match constraints [-Werror]
> #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in ‘asm’
> #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you
would use this to get error messages that aren't translated, that the
compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the
declarations of everything used in its operands, for us to get a handle
on what is going on here.  Bonus points if you manage to make a stand-
alone compilable testcase that shows the problem.

GL;HF,


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  2021-09-08 15:06 HON  LUU
@ 2021-09-08 16:20 ` Segher Boessenkool
  2021-09-08 16:26   ` HON  LUU
                     ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Segher Boessenkool @ 2021-09-08 16:20 UTC (permalink / raw)
  To: HON LUU; +Cc: gcc-help

Hi!

On Wed, Sep 08, 2021 at 03:06:54PM +0000, HON  LUU wrote:
>       + The modified gcc command did not compile. The error message would look like this.
> In file included from ././include/linux/compiler_types.h:58,
>                  from <command-line>:
> ./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
> ./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably doesn’t match constraints [-Werror]
> #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> ./include/linux/compiler-gcc.h:305:38: error: impossible constraint in ‘asm’
> #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
>                                       ^~~
> ./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
>   asm_volatile_goto("1:"
>   ^~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors

(Use LANG=C or LC_ALL=C to not get those weird quotes, just like you
would use this to get error messages that aren't translated, that the
compiler developers can actually read :-) )

You need to show the full code of the asm_volatile_goto, and the
declarations of everything used in its operands, for us to get a handle
on what is going on here.  Bonus points if you manage to make a stand-
alone compilable testcase that shows the problem.

GL;HF,


Segher

^ permalink raw reply	[flat|nested] 30+ messages in thread

* gcc question
@ 2021-09-08 15:06 HON  LUU
  2021-09-08 16:20 ` Segher Boessenkool
  0 siblings, 1 reply; 30+ messages in thread
From: HON  LUU @ 2021-09-08 15:06 UTC (permalink / raw)
  To: gcc-help

Hi,

I work on a project, that want to reuse device driver code in user space environment. The reason being that all RTL simulation, will be running on user space, but a portion of device driver code has a c-model which is served as “functional model” of corresponding RTL. We would like to device driver code unmodified in our RTL simulation/verification environment.

To achieve the goal, I set out to do the following:
     + Compile my device driver code using kernel KBuild system with V=1 to get gcc commands from the system for all my .c files
           Make V=1 -C /lib/modules/`uname -r`/build M=$(PWD) modules  ## the build completed without any issues, as expected.
     + For each gcc command for a .c files, I removed “-mcmodel=kernel -fno-PIE” and added “-fPIC”
           Orig:   gcc -Wp,-MD,/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/.cdev.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -DCONFIG_TPAUSE=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -D__READ_ONCE_DEFINED__ -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall -Werror -DRHEL8SP5 -DRHEL8 -DKERNEL_HAS_KCONFIG_H -DKERNEL_HAS_EXPORT_H -DDEBUGFS -I/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_access -I/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma -DKERNEL_193 -I/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/include -I/lib/modules/4.18.0-338.el8.x86_64/source/include -I.  -DMODULE  -DKBUILD_BASENAME='"cdev"' -DKBUILD_MODNAME='"qdma"' -c -o /home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/.tmp_cdev.o /home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.c
            Changed: :   gcc -Wp,-MD,/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/.cdev.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated   -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fPIC -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -DCONFIG_TPAUSE=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -D__READ_ONCE_DEFINED__ -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall -Werror -DRHEL8SP5 -DRHEL8 -DKERNEL_HAS_KCONFIG_H -DKERNEL_HAS_EXPORT_H -DDEBUGFS -I/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_access -I/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma -DKERNEL_193 -I/home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/include -I/lib/modules/4.18.0-338.el8.x86_64/source/include -I.  -DMODULE  -DKBUILD_BASENAME='"cdev"' -DKBUILD_MODNAME='"qdma"' -c -o /home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/.tmp_cdev.o /home/hon/work/FPGA-Driver-Software/components/nic/linux/driver/external/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.c
      + The modified gcc command did not compile. The error message would look like this.
In file included from ././include/linux/compiler_types.h:58,
                 from <command-line>:
./arch/x86/include/asm/jump_label.h: In function ‘unmap_user_buf.part.3’:
./include/linux/compiler-gcc.h:305:38: error: asm operand 0 probably doesn’t match constraints [-Werror]
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
                                      ^~~
./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
  asm_volatile_goto("1:"
  ^~~~~~~~~~~~~~~~~
./include/linux/compiler-gcc.h:305:38: error: impossible constraint in ‘asm’
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
                                      ^~~
./arch/x86/include/asm/jump_label.h:38:2: note: in expansion of macro ‘asm_volatile_goto’
  asm_volatile_goto("1:"
  ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:55: /home/hon/work/highlandrv/cosim.new/external/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.o] Error 1


I googled it quite a bit, but don’t know how to fix the error. I hope someone would give me a hint what went wrong and how to fix it, or point me to a right direction.

I appreciated your help and precious time.

Regards,
Hon
hon@dreambigsemi.com<mailto:hon@dreambigsemi.com>


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  2006-02-26 22:53 Brendan Darrer
  2006-02-26 23:52 ` Ernest L. Williams Jr.
@ 2006-02-27 15:29 ` Brian Budge
  1 sibling, 0 replies; 30+ messages in thread
From: Brian Budge @ 2006-02-27 15:29 UTC (permalink / raw)
  To: Brendan Darrer; +Cc: gcc-help

HI Brendan -

This is not really a gcc question, but here's a quick answer:

If you are using linux/unix, most likely "." is not in your path, so type:

./main.exe.

This may also apply for DOS, but I'm not sure about that.

  Brian

On 2/26/06, Brendan Darrer <bjdarrer2@hotmail.com> wrote:
> Hi,
>
> I have a problem compiling and running a simple gcc programme.
>
> directory contains:
>
> a.exe  main.cpp  main.exe
>
>
> I have greated main.exe using " gcc main.cpp -o main "
>
> I have tried typing " main " & " main.exe "
>
> error message - " bash: main.exe: command not found "
>
> What suggestions can you give to solve this.
>
>
> Regards,
>
> Brendan Darrer
>
>
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  2006-02-26 22:53 Brendan Darrer
@ 2006-02-26 23:52 ` Ernest L. Williams Jr.
  2006-02-27 15:29 ` Brian Budge
  1 sibling, 0 replies; 30+ messages in thread
From: Ernest L. Williams Jr. @ 2006-02-26 23:52 UTC (permalink / raw)
  To: Brendan Darrer; +Cc: gcc-help

On Sun, 2006-02-26 at 22:53 +0000, Brendan Darrer wrote:
> Hi,
> 
> I have a problem compiling and running a simple gcc programme.
> 
> directory contains:
> 
> a.exe  main.cpp  main.exe
> 
> 
> I have greated main.exe using " gcc main.cpp -o main "
> 
> I have tried typing " main " & " main.exe "
> 
> error message - " bash: main.exe: command not found "
> 
> What suggestions can you give to solve this.

Sounds like you have a path problem.
Are you running on UNIX or Windows?

If you are on UNIX/Linux, then execute the following:

./main.exe  

You need to tell the system that command is located in the current
directory.


Thanks,
Ernest


> 
> Regards,
> 
> Brendan Darrer
> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
@ 2006-02-26 22:53 Brendan Darrer
  2006-02-26 23:52 ` Ernest L. Williams Jr.
  2006-02-27 15:29 ` Brian Budge
  0 siblings, 2 replies; 30+ messages in thread
From: Brendan Darrer @ 2006-02-26 22:53 UTC (permalink / raw)
  To: gcc-help; +Cc: bjdarrer2

Hi,

I have a problem compiling and running a simple gcc programme.

directory contains:

a.exe  main.cpp  main.exe


I have greated main.exe using " gcc main.cpp -o main "

I have tried typing " main " & " main.exe "

error message - " bash: main.exe: command not found "

What suggestions can you give to solve this.


Regards,

Brendan Darrer


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: gcc question
  2002-06-12  9:29 j y
@ 2002-06-12 11:16 ` Shawn Starr
  0 siblings, 0 replies; 30+ messages in thread
From: Shawn Starr @ 2002-06-12 11:16 UTC (permalink / raw)
  To: j y; +Cc: gcc-help

You can, you need gcc 3.1.0. Use the -m64 compile option to build an
object as 64-Bit.

You may need other compile options but to build a basic 64-bit object
just specify -m64.


On Wed, 2002-06-12 at 12:29, j y wrote:
> can i use gcc (ultra solaris2.8 freeware 64 bit
> version) to compile a kernel driver code in 64 bit?.
> what would be the command syntax to do so, if yes?.
> mycode.c is 64bit kernel driver.
> r.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
-- 
Shawn Starr
Development Support Engineer, Operations
Datawire Communication Networks Inc.
10 Carlson Court, Suite 300
Toronto, ON, M9W 6L2
T: 416-213-2001 ext 179  F: 416-213-2008

^ permalink raw reply	[flat|nested] 30+ messages in thread

* gcc question
@ 2002-06-12  9:29 j y
  2002-06-12 11:16 ` Shawn Starr
  0 siblings, 1 reply; 30+ messages in thread
From: j y @ 2002-06-12  9:29 UTC (permalink / raw)
  To: gcc-help

can i use gcc (ultra solaris2.8 freeware 64 bit
version) to compile a kernel driver code in 64 bit?.
what would be the command syntax to do so, if yes?.
mycode.c is 64bit kernel driver.
r.

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

^ permalink raw reply	[flat|nested] 30+ messages in thread

* gcc question
@ 2001-07-20  4:35 Steve Kieu
  0 siblings, 0 replies; 30+ messages in thread
From: Steve Kieu @ 2001-07-20  4:35 UTC (permalink / raw)
  To: gcc-help

Hi everyone,

I got a question, does gcc always use the correct
option -march=iX86 in the computer it is running or I
have to specify it?

eg. I use i686 machine running Linux, when compile
program I want gcc make binary optimized for i686, do
I have to specify -march=i686 or gcc will
automatically detect this and does it (unless I force
it using -march=i386 to bring this baniry to run in
other computer of course)

Thanks in advance.





=====
S.KIEU

_____________________________________________________________________________
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!

^ permalink raw reply	[flat|nested] 30+ messages in thread

* gcc question
@ 2000-08-13 19:34 tao tong
  0 siblings, 0 replies; 30+ messages in thread
From: tao tong @ 2000-08-13 19:34 UTC (permalink / raw)
  To: help-gcc

Hello:
       I have a question with gcc.
The following is question description:

        Program:
                void malloc()
 	{
 	}
 	main()
 	{
 		malloc();
 	}
         when executing gcc ,a problem takes place,
 "Internal compiler error: cc1 got fatal signal 11";
 when replacing the "malloc" with "free",there is no
 problem.

         environment description:
 	platform: intel pIII,450Mhz
 		128Mram
 	os          :Redhat 6.1
 		kernel 2.2.12
 	gcc        :gcc version egcs-2.91.66                   19990314/Linux
(egcs-1.1.2 release)

 			Thanks
 			tongtao@sohu.com

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: GCC question
  2000-04-10  7:46 Gibson, Terry
@ 2000-04-10  8:12 ` Alexandre Oliva
  0 siblings, 0 replies; 30+ messages in thread
From: Alexandre Oliva @ 2000-04-10  8:12 UTC (permalink / raw)
  To: Gibson, Terry; +Cc: 'help-gcc@gnu.org'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

On Apr 10, 2000, "Gibson, Terry" <TGibson@bellhelicopter.textron.com> wrote:

> During the build, the "bison" script cannot be located along with
> the "bison" directory.

bison is a program, not a script.  You may download it from
ftp.gnu.org too, but you shouldn't need it, unless you modified the
timestamps of any bison-generated files.  Did you?

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 30+ messages in thread

* GCC question
@ 2000-04-10  7:46 Gibson, Terry
  2000-04-10  8:12 ` Alexandre Oliva
  0 siblings, 1 reply; 30+ messages in thread
From: Gibson, Terry @ 2000-04-10  7:46 UTC (permalink / raw)
  To: 'help-gcc@gnu.org'

Hello,

I recently downloaded the GCC (gc-2.95.2.tar.gz) and am having a problem
building it on my Sun worksation running Solaris 2.6. During the build, the
"bison" script cannot be located along with the "bison" directory.  This
directory and it's files are not in the downloaded archive.  Am I missing
something here?

Thanks,
Terry Gibson
Sr. Engineering Specialist
Bell Helicopter Textron, Inc
tgibson@bellhelicopter.textron.com
817.280.5451

^ permalink raw reply	[flat|nested] 30+ messages in thread

* GCC question
  2000-01-06 15:46 Black, Christopher T
@ 2000-04-01  0:00 ` Black, Christopher T
  0 siblings, 0 replies; 30+ messages in thread
From: Black, Christopher T @ 2000-04-01  0:00 UTC (permalink / raw)
  To: 'gnu@gnu.org'

Hello and thank you for you time,

I have looked at the available source but cannot find a clear answer to the
list of platforms that GCC will run on.  Is there a URL that you can provide
that I can get this info from?  Specifically, I need to know if it runs on
OS390 under OpenEdition.

Thank you again,

Chris Black

^ permalink raw reply	[flat|nested] 30+ messages in thread

* GCC question
@ 2000-01-06 15:46 Black, Christopher T
  2000-04-01  0:00 ` Black, Christopher T
  0 siblings, 1 reply; 30+ messages in thread
From: Black, Christopher T @ 2000-01-06 15:46 UTC (permalink / raw)
  To: 'gnu@gnu.org'

Hello and thank you for you time,

I have looked at the available source but cannot find a clear answer to the
list of platforms that GCC will run on.  Is there a URL that you can provide
that I can get this info from?  Specifically, I need to know if it runs on
OS390 under OpenEdition.

Thank you again,

Chris Black

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2021-09-13 19:52 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <947048956.20674.ezmlm@gcc.gnu.org>
2000-01-04 21:22 ` GCC question John Ratcliff
2000-04-01  0:00   ` John Ratcliff
2000-01-06 15:46 Black, Christopher T
2000-04-01  0:00 ` Black, Christopher T
2000-04-10  7:46 Gibson, Terry
2000-04-10  8:12 ` Alexandre Oliva
2000-08-13 19:34 gcc question tao tong
2001-07-20  4:35 Steve Kieu
2002-06-12  9:29 j y
2002-06-12 11:16 ` Shawn Starr
2006-02-26 22:53 Brendan Darrer
2006-02-26 23:52 ` Ernest L. Williams Jr.
2006-02-27 15:29 ` Brian Budge
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 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).