« Return to Thread: Compilation problems on Ubuntu 64-bit

Re: Compilation problems on Ubuntu 64-bit

by Marcus Clyne :: Rate this Message:

Reply to Author | View in Thread

Hi,

I've got it to work, by adding a 'main' function to my shared object code.

I don't understand why I need to do this though.  I didn't think that
'main' functions were required in shared objects, and when I compile
using the shell, it compiles ok without one.  When I used the same code
on my old system, it worked without needing to add one, even in the exec
function executions.

Could this be a bug in GCC?  The version I'm using currently is 4.3.3.

Alternatively, is there another option I should add when using exec
functions to call GCC to prevent the need for adding 'main' functions?

Thanks,

Marcus.


Marcus Clyne wrote:

> I've tried adding all the elements in the environment, but it still
> doesn't work. :-(
>
> Is there any reason why gcc/ld called from exec functions would have
> different options set (other than those relating to the environment)
> compared to being called from within a shell?
>
> Marcus.
>
>
> Ian Lance Taylor wrote:
>> Marcus Clyne <maccaday@...> writes:
>>
>>  
>>> I think I need to add something to the environment, but am not sure
>>> what.
>>>    
>>
>> We don't know either.  I recommend running printenv to see what you have
>> in your environment, adding all of it to your execve call, verify that
>> it works, and then remove items one by one until it fails.
>>
>> Ian
>>
>>  
>
>

 « Return to Thread: Compilation problems on Ubuntu 64-bit